1. Jon Stoller
  2. PowerBuilder
  3. Tuesday, 14 August 2018 04:15 AM UTC

I am using PowerBuilder 2017.   I need to create a PDF file in my application. 

I am able to save a file as a PDF when I do it on my own PC.  But the PDF does not get created on other systems where I installed the compiled application.

So my question is, how do I create and save a file as a PDF so it works on other systems? 

The following is the code I use to save the file: 

string  ls_folderfile
integer li_return
ls_folderfile = "c:\pdf\pklist01.pdf"

ldw_rpt.Object.DataWindow.Export.PDF.Method = XSLFOP!
li_return = ldw_rpt.SaveAs(ls_folderfile, PDF!, true)

When I run this code on my PC, the PDF is successfully created. 
When I run it on another system, the PDF is not created. 

What is the problem. 
What should I be doing to create the PDF file on other systems?

Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 22 August 2018 09:57 AM UTC
  2. PowerBuilder
  3. # 1

Hi Hung,

  1.  Please check and see if you are on the latest PB, i.e. PB 2017 R3 build 1858. In this latest release a bug that setting Arabic as the regional language caused failure in generating PDF with NativePDF was fixed.  So if you are not on this latest release, please upgrade it to this latest release and try again and see if it works.

You may download and install this latest release from our Downloads portal at https://www.appeon.com/user/center/index?menu=download  (requires login) or you may manually go to the Downloads portal from Login (to the Appeon Website) > User Center (under your login user icon) > Downloads.

  1. Please make sure that you have write permission over the %temp% folder on the current PC.
  2. Please copy the attached log.ini to the %temp% folder (default directory:C:\Users\appeon\AppData\Local\Temp)and then try to generate PDF file with NativePDF. Log files will be generated in this folder and please provide those generated log files for further analysis.
  3. Please let us know your Operation System and the system language: (e.g. 32-bit Window 7, English).

What’s the difference between those PCs that work and those that don’t?

  1. Kindly please report your PB issue via our support ticketing system to ensure it is being properly received by our tech support and tracked at: https://www.appeon.com/standardsupport/

     Please attach the log files generated (mentioned above) when opening the ticket. Thanks in advance.

 

Regards,

Mark Lee

--------------------------------------------------------------------------------------------------------------------------------------

I ran in similar problem with creating PDF files in PB2017 R2.  I changed my app from using Ghostscript to NativePDF.  The exe works find on my development PC and it works on some of the users PCs but not others.  I am still figuring out what the problem is.  I've also read the PowerBuilder’s PDF Evolution blogs (link listed above from Armeen Mazda.)  I agree using NativePDF new features had many advantages PB documentation is not very clear.  In addition, the blog indicated "improving the built-in PDF feature in following revisions (e.g. R2 and R3)."  I read the release not but did not find any mention about PDF in R3, Can someone please confirm new PDF feature in R3?  I am currently using R2, should I upgrade to R3 to get rid of the problem.

Here is what I did

  - Data Export tab of my datawindow

  - Format to configure set to PDF

  - Method NativePDF!

  - PDF Conformance None

  - Save the datawindow

If you open the data window again it will show the default "Format to configure XML"

 

// Script on the print button

// Set datawindow to export using PDF Native
dw_rpt_to_print.Object.DataWindow.Export.PDF.Method = NativePDF!
dw_rpt_to_print.Object.DataWindow.Export.PDF.NativePDF.UsePrintSpec = 'No'

// Portrait
dw_rpt_to_print.Object.DataWindow.Export.PDF.NativePDF.CustomOrientation = 2

 

dw_rpt_to_print.InsertRow(1)

dw_rpt_to_print.Object.commnent_txt[1] = "This is a test"

ll_rc = dw_rpt_to_print.SaveAs( "test.pdf", PDF!, TRUE )

IF ll_rc = -1 THEN
  ls_msg = "ERROR -- Failed to create PDF file"
  ls_msg += "~n~nPlease Contact System Support For Assisstance!"
  gnv_app.uf_message( ls_msg, -1 )
  RETURN -1
END IF

The PDF files printed on some user PCs but not others.

 

 

 

Attachments (1)
Comment
There are no comments made yet.
Hung Doan Accepted Answer Pending Moderation
  1. Tuesday, 21 August 2018 14:02 PM UTC
  2. PowerBuilder
  3. # 2

I ran in similar problem with creating PDF files in PB2017 R2.  I changed my app from using Ghostscript to NativePDF.  The exe works find on my development PC and it works on some of the users PCs but not others.  I am still figuring out what the problem is.  I've also read the PowerBuilder’s PDF Evolution blogs (link listed above from Armeen Mazda.)  I agree using NativePDF new features had many advantages PB documentation is not very clear.  In addition, the blog indicated "improving the built-in PDF feature in following revisions (e.g. R2 and R3)."  I read the release not but did not find any mention about PDF in R3, Can someone please confirm new PDF feature in R3?  I am currently using R2, should I upgrade to R3 to get rid of the problem.

Here is what I did

  - Data Export tab of my datawindow

  - Format to configure set to PDF

  - Method NativePDF!

  - PDF Conformance None

  - Save the datawindow

If you open the data window again it will show the default "Format to configure XML"

 

// Script on the print button

// Set datawindow to export using PDF Native
dw_rpt_to_print.Object.DataWindow.Export.PDF.Method = NativePDF!
dw_rpt_to_print.Object.DataWindow.Export.PDF.NativePDF.UsePrintSpec = 'No'

// Portrait
dw_rpt_to_print.Object.DataWindow.Export.PDF.NativePDF.CustomOrientation = 2

 

dw_rpt_to_print.InsertRow(1)

dw_rpt_to_print.Object.commnent_txt[1] = "This is a test"

ll_rc = dw_rpt_to_print.SaveAs( "test.pdf", PDF!, TRUE )

IF ll_rc = -1 THEN
  ls_msg = "ERROR -- Failed to create PDF file"
  ls_msg += "~n~nPlease Contact System Support For Assisstance!"
  gnv_app.uf_message( ls_msg, -1 )
  RETURN -1
END IF

The PDF files printed on some user PCs but not others.

 

 

Comment
There are no comments made yet.
Bruce Armstrong Accepted Answer Pending Moderation
  1. Wednesday, 15 August 2018 15:14 PM UTC
  2. PowerBuilder
  3. # 3

Both the Distill and XLSFOP methods of generating PDF are dependant on the installation of a third party product on the computer (GhostScript for Distill and Apache FOP for XLSFOP).  It's likely you didn't install FOP on the other computer or it's not configured correctly.  I would recommend looking at the Native PDF capability that was added in 2017, and only required the distribution of an additional runtime file.

Comment
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 14 August 2018 04:35 AM UTC
  2. PowerBuilder
  3. # 4

Please consider to switch off of XSLFOP as that is PB 7 feature that has a number of shortcomings. 

A couple suggestions I have is:

1. Read this article about the new NativePDF feature of PB 2017 to better understand how NativePDF compares to XSLFOP: https://community.appeon.com/index.php/blogs/recent-blogs/powerbuilder-s-pdf-evolution 

2. If the NativePDF feature interests you, upgrade to PB 2017 R3.  There are a number of enhancements made to the new NativePDF generation capability.  And of course, evaluate if it meets your project needs.

 

Comment
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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.