The ExportToPDF function creates a PDF file using the US Letter page size. My graphs are A4 so they end up being fitted to Letter size and leaving a large margin at the bottom. I can't find a setting within DIAdem or a reference to PDF page size in the help files, so does anyone have any idea if it can be controlled?
Solved! Go to Solution.
Perhaps I wasn't clear enough in my original post. The page size is set to A4 in DIAdem but PDFExport produces a document using Letter page size.
So the graph is reduced to fit, leaving a margin at the bottom of each page:
Please can you check the PDF output with this script:
call data.Root.Clear call DataFileLoad(ProgramDrv & "\Examples\Data\Example_data.tdm") call Report.LoadLayout(ProgramDrv & "\Libr\Documents\Example.tdr") call Report.Refresh Report.Settings.Page.Dimensions.UseScaledOutput = false Report.Settings.Page.Dimensions.Ratio = 0.7 call Report.Sheets.ExportToPDF("D:\Test\Test", false)
What are the settings in the printer setting dialog?
Here are some script commands regarding the format of a Printer:
'returns the possible supported formats
msgbox PrinterPaperSizeListGet("winspool,DIAdem PDF Export,nul:")
'returns the selected format
msgbox PrinterPaperSizeGet("winspool,DIAdem PDF Export,nul:")
' sets the format (persistent)
call PrinterPaperSizeSet("A4", "winspool,DIAdem PDF Export,nul:")
I think you've found the problem.
Do you happen to know why it was set to letter in the first place? Is this a DIAdem thing or a Windows thing or an Adobe thing? I ask this last questions because the settings on all my colleagues machines will probably be the same as mine.
Finally, I assume I can add the last function you gave (PrinterPaperSizeSet) to my code to force the paper size each time a script is run?
This setting depends on the OS language. If the language is English, then the size is set to “Letter” otherwise it is “A4”.