1. Roland Smith
  2. PowerBuilder
  3. Monday, 20 April 2020 16:52 PM UTC

Using PowerBuilder 2019 GA Build 2082.

I want to change from Ghostscript to NativePDF without having to update all the DataWindow objects.

Other than the method and pagesize properties, what other properties should be set so that I get a successfully created PDF file?

I did a search of the forum, the other properties mentioned were in the question so I couldn't tell if they were really needed.

 

Roland Smith Accepted Answer Pending Moderation
  1. Monday, 20 April 2020 17:05 PM UTC
  2. PowerBuilder
  3. # 1

Basically I'm wondering if this is sufficient.

// set method to NativePDF
ads_datastore.Modify("DataWindow.Export.PDF.Method = 2")

// set paper size to 8 1/2 x 11
ads_datastore.Modify("DataWindow.Export.PDF.NativePDF.CustomSize = 5")

// save to PDF
Return ads_datastore.SaveAs(as_filename, PDF!, TRUE)

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 20 April 2020 17:12 PM UTC
  2. PowerBuilder
  3. # 2

Hi Roland;

   In PB2019 R2 ....

 

In PB2017R3/2019 ...

Create your own PB.INI file in the App's folder, with the following entry

[Data Window]
; 1 = Use Native, 0 = GhostScript or XLSFO
NativePDF_Valid=1

Now deploy that INI with your App's EXE into production as well.   ;-)

HTH

Regards ... Chris

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 20 April 2020 17:29 PM UTC
  2. PowerBuilder
  3. # 3

After some more testing, the issue we are seeing is that NativePDF defaults to A4 while GhostScript & physical printing default to 8.5 x 11.

Because of that, we have to add this line of code:

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

 

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Monday, 20 April 2020 18:11 PM UTC
  2. PowerBuilder
  3. # 4

Hi, Roland -

We delayed migration of our app from 12.5.2 to 2017 until R2 came out because the initial implementation in R1 was not capable of meeting our needs. In our framework (we use the PFC) we extended the DataWindow Control (u_dw) and DataStore (n_ds) to interrogate the DataWindow.Export.PDF.Method setting, changing the value to '2' (NativePDF!). Once that Modify was performed, we also set DataWindow.Export.PDF.NativePDF.ImageFormat to '1' (JPG) to reduce the size of the PDF's that contain images, such as logos (all images in our product are in JPG format), and DataWindow.Export.PDF.NativePDF.UsePrintSpec to 'yes' (because the default is 'no') so that we would not have to try to manage the paper size, orientation, etc. settings.

HTH, John

Comment
  1. Roland Smith
  2. Monday, 20 April 2020 18:23 PM UTC
Thanks
  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.