Questions? Feedback?powered byOlark live chat software
Bug 400

Empty PDF when SaveAs NativePDF from a webservice. 13 May, 2019

Aart Onkenhout
28 September, 2017
Product: PowerBuilder Category: DataWindow
Version: 2017 Publishing: Public
Status: Scheduling Priority: P3
Classification: Appeon bug Resolution:
Mark Lee 24 April, 2018
Hi Aart,
 
We’ve verified it in PB 2017 R2 and found PDF files can be generated already. However there will be extra borders in the generated PDF. We’ll keep working on this issue and will get back to you when it is completely fixed. 
You may try to verify it with PB 2017 R2 and see if it is acceptable. 
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.
select GA type before you click on the Search button, and you will find the associated PowerBuilder Universal #1769 download links.

Please note that installing PowerBuilder 2017 R2 requires you to uninstall PowerBuilder 2017 first.

Regards,
Mark Lee
Mark Lee 27 October, 2017
Hi Aart,
 
Sorry that this problem is not fixed so far.
Currently webservice is not supported with NativePDF and it’s not clear yet when it would be supported.
 
Kindly please work it around by using Ghostscript for your case.
The PDF file is generated one by one even with NativePDF and there’s dwpage.enf file for each PDF generated with NativePDF (which is a bug and will probably be fixed in our next version around the end of this year).
 
And yes, the nativepdf option does not need a printer.

Regards,
Mark Lee
Aart Onkenhout 26 October, 2017
Hi Mark,

Any news on this one? (By the way, I just read the last sentence of https://community.appeon.com/groups/powerbuilder/question-about-native-pdf, stating nativepdf isn't available with webservices).

Let me explain why we like to use nativepdf. I wrote a webservice to create invoices (composite datawindow), save them as a pdf, read the pdf into a blob and save it into the database. As we have many thousands of invoices to create this way we like to call the webservice simultaneously a couple of times (by setting the number of workers within IIS). With the ghostscript method they all use the same 'Sybase DataWindow PS' printer and, as far as we can see, the second one trying to save the datawindow as pdf has to wait for the first one to finish and so on. As the nativepdf option doesn't require a printer (if I'm right) this could speed up the process of creating pdf files.

When trying to save as PDF using the XSLFOP! option the saveas returns -1, probably this has to with the composite datawindow.

Hope to hear from you (if you have other ideas I like to hear them too).

Regards,
Aart
Mark Lee 11 October, 2017
Hi Aart,

Thanks for your quick update.
We’ll transfer your comments to our development team for consideration.

Regards,
Mark Lee
Aart Onkenhout 11 October, 2017
(In reply to Mark Lee from comment #4)
Hi Aart,

Please try to add the following scripts and see if the formatting issue can
be corrected.
// save pdf file in temp directory
dw.Modify("DataWindow.Export.PDF.Method = XSLFOP! ")
dw.Modify("DataWindow.Print.Orientation=2")
dw.Modify("DataWindow.Print.Paper.Size=9")
ll_return = dw.SaveAs("test_3.pdf", PDF!, false)

Regards,
Mark Lee
Hi Mark, this change gives me the same results as without those lines of code.
Mark Lee 10 October, 2017
Hi Aart,

Please try to add the following scripts and see if the formatting issue can be corrected.
// save pdf file in temp directory
dw.Modify("DataWindow.Export.PDF.Method = XSLFOP! ")
dw.Modify("DataWindow.Print.Orientation=2")
dw.Modify("DataWindow.Print.Paper.Size=9")
ll_return = dw.SaveAs("test_3.pdf", PDF!, false)

Regards,
Mark Lee
Aart Onkenhout 29 September, 2017
With this change I'm getting a pdf with contents indeed. But it looks different from the ghostscript version (or nativepdf version), especially when the contents are wider than the page width (say A4 format).
Mark Lee 28 September, 2017
Hi Aart,

Thanks for reporting the problem.
We will escalate this problem to our development team for further analysis!
We need some time to figure it out, we will get back to you if any process we would make.

Please try to add the below scripts to work it around temporarily.
// save pdf file in temp directory
dw.Modify("DataWindow.Export.PDF.Method = XSLFOP! ")
ll_return = dw.SaveAs("test_3.pdf", PDF!, false)

Please let us know if this resolves your problem.
Thanks in advance.

Regards,
Mark Lee
Aart Onkenhout 28 September, 2017
TestProject.zip (7KB)

*Phenomenon:
When saving the contents of a datawindow (or datastore) to PDF from a webservice an empty pdf is created when using NativePDF. When saving as PDF with ghostscript a correct pdf is created.

*Reproduce Steps:
Attached is an simple demo workspace. This creates a webserice with a generatepdf function. When running it it creates a correct html-file but an empty pdf.

Remark:
OS:
Windows 7 
Platform:
64-bit 
Database Type:
 
Database Version: