1. Thierry Del Fiore
  2. PowerBuilder
  3. Monday, 14 March 2022 13:20 PM UTC


in order to get rid off Ghostscript, we're using NativePDF to save datawindow as PDF.

We just migrate from PB2019R2 to PB2019R3, and it seems that the PDF generated are not the same size anymore.

It's like the margin are bigger and also a larger zoom, with the result that some columns are moving to the right, creating a new page.

we use : 

dw.Object.DataWindow.Export.PDF.NativePDF.UsePrintSpec = 'Yes'

dw.Object.DataWindow.Print.Paper.Size = '0'

the default is A4  and if we set the value to 9 (A4) we have another (better) result but still different from print preview

If I remember, we experienced this issue in PB2019R1 that was solved in R2 but it's back again in R3.

What we want is the same result in PDF as in the Print preview datawindow.

What would be the values to set ? Is this problem still present in PB2021 ?

Best regards

Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 15 March 2022 09:40 AM UTC
  2. PowerBuilder
  3. # 1

Hi Thierry,


Thanks for reporting this problem.
1. As far as I know, the current NativePDF function in PowerBuilder doesn't support margin setting, not even in PowerBuilder 2021.
However, based on my latest internal test, the PB2022 version will be enhanced for NativePDF related features.
We recommend that you do an experience test on this function when PowerBuilder 2022 Beta is released.

2. If you want the same result as in the print preview DataWindow, we suggest that you verify if GhostScript can achieve what you expect. If GhostScript doesn't meet your needs, NativePDF probably won't be able to implement it neither. I would suggest that you adjust your print content and layout instead.

Also, if your DataWindow export has a non-default margin setting, we suggest that you try to set the default printer to a virtual machine printer and set the value to 9 (A4) to see if it works better?




  1. Thierry Del Fiore
  2. Tuesday, 15 March 2022 10:17 AM UTC

All datawindows have PB default values for the 4 margins.

By forcing dw.Object.DataWindow.Print.Paper.Size = '9' (A4) , the PDF is better generated in one page (even if it's not quite the same as dw preview or Ghostscript PDF)

So we will use this workaround.


Remarks : We won(t be able to move to PB2022 since you have decided to remove .NBT Soap Webservices, but that's another story.
  1. Helpful
There are no comments made yet.
Thierry Del Fiore Accepted Answer Pending Moderation
  1. Tuesday, 15 March 2022 09:19 AM UTC
  2. PowerBuilder
  3. # 2

See attachment , same datawindow exported in nativePDF PB2019R2 and R3-> the margin are different

Attachments (2)
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 15 March 2022 02:31 AM UTC
  2. PowerBuilder
  3. # 3

Hi, Thierry -

When the DW is in Print Preview, is the user's selected/default printer the same one that will eventually print the DW? Print preview uses the attributes of the current printer when rendering the preview, so any differences might be due to this.

Regards, John

  1. Thierry Del Fiore
  2. Tuesday, 15 March 2022 09:22 AM UTC

The default printer has not been changed and we have the same behaviour on different client PC with different printer

The only thiing that has changed is the migration from R2 to R3

You can see in the pictures below that margins are different
  1. Helpful
There are no comments made yet.
  • Page :
  • 1

There are no replies made for this question yet.
However, you are not allowed to reply to this question.