- Larry Peters
- PowerBuilder
- Wednesday, 5 February 2025 02:57 AM UTC
I'm using Powerbuilder 2022R3 Build 3356.
I have a nested datawindow - about 6 pages long. Within my app I preview the datawindow and offer the user a button to create a PDF file.
I have two methods to create the PDF:
1. Using NativePDF
adw.Object.DataWindow.Export.PDF.Method = '2'
adw.Object.DataWindow.Export.PDF.NativePDF.UsePrintSpec = 'Yes'
adw.Object.Datawindow.Print.FileName = is_pdffilename
adw.SaveAs(is_pdffilename, PDF!, True)
2. Using Microsoft Print to PDF
adw.Object.DataWindow.Print.PrinterName = 'Microsoft Print to PDF'
adw.Object.DataWindow.Print.FileName = is_pdffilename
adw.Print()
The two PDFs are quite different! Placed side-by-side in a tabbed browser you can see how the fonts, positions, lines are subtly different. This is not really a problem. But what IS a problem is that sometimes, if the datawindow data is sufficiently complex, then one rendering can have the lines different. Nothing is missing but one may have x lines on page 1 while the other has x+3 lines! The Preview may have x+3 lines; The Microsoft PDF will always be the same - x+3 lines; but the NativePDF can have x lines! Is this a documented bug/feature and if so is there a work-around? I would prefer to NOT need to use Microsoft if I can avoid it.
Attached SamplePDF.pdf
TIA
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.