The default for PDF is A4 instead of the using datawindow's defined paper size.
This is some code i put together so that the pdf saves the way you probably expect it to: it will use settings from the datawindow
ls_size = dw.describe("DataWindow.Print.Paper.Size")
choose case ls_size
case '0', '1', '2'
ls_size = '5' //8.5 X 11
case '5'
ls_size = '6' //legal
case '3', '4' // 17" x 11"
ls_size = '6' //legal
case '8'
ls_size = '3' //A3
case '9', '10' //9 – A4 210 x 297 mm
ls_size = '4' //a4
case else
ls_size = '5' //8.5 X 11
end choose
dw.Modify("DataWindow.Export.PDF.Method = NativePDF! DataWindow.Export.PDF.NativePDF.CustomSize = '" + ls_size + "' DataWindow.Export.PDF.NativePDF.customorientation='0' ") //
customorientation of 0 means use datawindow settingll_rc = dw.SaveAs (ls_filepath, PDF! , true)
The new pdf will lower the resolution/quality of the image, however that is very subjective as to how bad it really is. If you start with a higher resolution image, then (IMO) the drop down in resolution won't be noticeable when the pdf is printed. Even a low resolution image may be ok. I'm leaning towards using the new PDF option even though i expect that most images such as logos are lower resolution and will be noticeable worse.