and calling GetPaperLength, the new length of the paper seems to be set correctly, but when printing the pdf file the paper size is still the same.
Two issues should be checked:
1. When calling SetPaperLength, and SetPaperWidth, one need to call SetDefaultConfig so the new settings apply to the new documents of all applications.
2. Although one can define a default paper size inside the printer, the paper size can be redefined in the application and override the printer definitions