12-01-2021 10:13 AM
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.
12-07-2021 02:40 AM
This is a general setting in the layout parameters:
12-07-2021 03:48 AM
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:
12-07-2021 05:39 AM
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)
12-07-2021 06:55 AM
Same problem I'm afraid.
12-07-2021 07:23 AM
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:")
12-07-2021 08:13 AM
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?
12-07-2021 08:32 AM
This setting depends on the OS language. If the language is English, then the size is set to “Letter” otherwise it is “A4”.
12-07-2021 08:59 AM
Well, that's charming of Microsoft.