PowerBuilder 2019R3, b2703
Oracle 12C and PostgreSQL v12
IDE: Windows 10 64 bit o/s
Runtime: Windows 19 server
What components are required to get the SAVE AS into a PDF file to work correctly?
Do I need the Sybase Datawindow PS driver? If so, is there an installer for this?
Any specific DLLs?
Ghostscript?
Anything else?
I'm having serious difficulty getting this to work on the Windows 19 server.
Thank You,
Olan
- You are here:
- Home
- Q&A
- Q&A
- PowerBuilder
- SAVE AS PDF - What do I need?
- Olan Knight
- PowerBuilder
- Tuesday, 30 November 2021 00:54 AM UTC
- Tuesday, 30 November 2021 15:30 PM UTC
- PowerBuilder
- # Permalink
Create a function with the below code in your base datastore/datawindow object called SaveAsNativePDF that returns integer and has string as_filename as the argument.
this.Object.DataWindow.Export.PDF.Method = '2'
this.Object.DataWindow.Export.PDF.NativePDF.UsePrintSpec = 'Yes'
Return this.SaveAs(as_filename, PDF!, True)
This will save the report to a PDF file using the built in NativePDF feature.
- Tuesday, 30 November 2021 22:28 PM UTC
- PowerBuilder
- # 1
Roland -
The code you provided works perfectly - thank you again - but it ONLY creates PDFs from those DWOs whose margins fall within 8". If I have a DWO whose populated width is 17" margins, the PDF does not get created.
I expect that over-wide pages on a PORTRAIT print setting will be automatically broken into multiple pages, and that's not occurring.
Is there a setting I need to tweak? An option I need to set?
Thanks,
Olan
- Chris Pollach @Appeon
- Wednesday, 1 December 2021 16:13 PM UTC
I would try ....
DC.Modify("DataWindow.Print.Paper.Size='3'") // Tabloid 11x17 or 4 - Ledger 17x11
DC.Modify("DataWindow.Print.Orientation= '1'" ) // Landscape
DC.Modify("DataWindow.Export.PDF.NativePDF.UsePrintSpec=Yes") // Use Settings in Print Specification
HTH .. Regards ... Chris
-
Helpful Loading... Helpful 1
- Olan Knight
- Wednesday, 1 December 2021 18:27 PM UTC
Just one of those things, I guess.... :/
-
Helpful Loading... Helpful 0
- Tuesday, 30 November 2021 18:06 PM UTC
- PowerBuilder
- # 2
Just some random question which might not have anything to do:
Is there a default printer installed for the user that runs the applicaion on the windows 2019 server? Not sure if that's still important.
regards
- Olan Knight
- Tuesday, 30 November 2021 18:19 PM UTC
Implementing the solution Roland provided resolved the situation for the SAVE AS command.
Now I'm working on getting the PRINT command to work properly on these new servers. :/
-
Helpful Loading... Helpful 0
- Tuesday, 30 November 2021 15:44 PM UTC
- PowerBuilder
- # 3
"I'm having serious difficulty getting this to work on the Windows 19 server."
this implies that you get it to work on other machines? Does it work on other machines that are not your development machine?
- Olan Knight
- Wednesday, 1 December 2021 16:26 PM UTC
-
Helpful Loading... Helpful 0
- Miguel Leeuwe
- Wednesday, 1 December 2021 17:49 PM UTC
-
Helpful Loading... Helpful 0
- Tuesday, 30 November 2021 01:46 AM UTC
- PowerBuilder
- # 4
Hi Olan;
Is there a reason that your trying to use the old Ghostscript PDF rendering technique vs the newer NativePDF PB built-in feature?
Regards ... Chris
- Olan Knight
- Tuesday, 30 November 2021 17:19 PM UTC
That, and I am not familiar with the Native PDF functionality.
Finally, I was trying to stay with the old code until the bugs were mostly resolved with the Native PDF processing. :)
-
Helpful Loading... Helpful 1
- Page :
- 1
However, you are not allowed to reply to this question.
Thanks, Roland, that is exactly what I need. WIll try it out right now.
Thank you!