1. Jason Lipman
  2. PowerBuilder
  3. Monday, 30 April 2018 13:37 PM UTC
++ PB 2017 R2
Hello all,
 
I am writing a script to take in a PSR file, then Save As PDF. It seems the conversion to PDF does not automatically determine portrait/landscape. I'm playing with code to figure that out.
 
ISSUE: I have many PSR files that were never meant to be printed, and have columns that go up to 5 page widths long. I am playing with the one code change I am aware of to save into PDF with the correct width, but NOTHING seems to change.
 
Example:
        dw_pdf.Modify("DataWindow.Print.Paper.Size=255")   
        dw_pdf.Modify("DataWindow.Print.CustomPage.Width=22000")   //22.000 inches wide
        dw_pdf.SaveAs(dw_from_psr, PDF!, FALSE)
 
And ideas on how to print from PSR to PDF and carry over the widths accurately?
Jason Lipman
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 30 April 2018 13:51 PM UTC
  2. PowerBuilder
  3. # 1

Hi Jason;

  I am not sure that mechanism you are aiming to use for the PDF generation. The PSR would default to the old XLSFO process. Of course in PB 2017 you have GhostScript and NativePDF alternatives as well. You would need to set the PDF mechanism though first and then set the respective DWO properties for the corrrect generation.

Example: 

  • .Object.DataWindow.Export.PDF.Method=<Distill!, XSLFOP!, NativePDF!>
  • .Object.DataWindow.Export.PDF.NativePDF.CustomOrientation='<0 - Default, 1 - Landscape, 2 - Portrait>'
  • .Object.DataWindow.Export.PDF.NativePDF.CustomSize='<0 - Default, 1 - A1 594 x 841 mm, 2 - A2 420 x 594 mm, 3 - A3 297 x 420 mm, 4 - A4 210 x 297 mm, 5 - letter 8 1/2 x 11 in, 6 - Legal 8 1/2 x 14 in>'
  • .Object.DataWindow.Export.PDF.NativePDF.PDFStandard='<0 - None, 1 - PDF/A-1a, 2 - PDF/A-1b, 3 - PDF/A-3a, 4 - PDF/A-3b, 5 - PDF/A-3u>'
  • .Object.DataWindow.Export.PDF.NativePDF.UsePrintSpec=''

Regards ... Chris

Comment
  1. Jason Lipman
  2. Monday, 30 April 2018 17:46 PM UTC
Chris,



I got that out of the way. I can save the PSR file as a PDF .. no issues there. I am using the new NativePDF method.



However, viewing the PSR file in a datawindow, it my issue, the width is very long. It will not Save As into the PDF file as such, but moves the long width into multiple pages instead. That is the problem I am trying to solve.



Jason

  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 30 April 2018 18:24 PM UTC
 It should work in Landscape more ( I would think).



I have not tried this wide a form though.

  1. Helpful
There are no comments made yet.
Jason Lipman Accepted Answer Pending Moderation
  1. Tuesday, 1 May 2018 15:15 PM UTC
  2. PowerBuilder
  3. # 2

When saving a datawindow to PDF via NativePDF, can anyone confirm if, when using...

        dw.Modify ("DataWindow.Export.PDF.NativePDF.UsePrintSpec = Yes")

.. if the following should work...

        dw_pdf.Modify("DataWindow.Print.Paper.Size=255")   
        dw_pdf.Modify("DataWindow.Print.CustomPage.Width=22000")   //22.000 inches wide

It is still not working, and I've tried a variety of setting combinations for NativePDF. Perhaps there are some prevailing bugs in Native PDF?

Jason Lipman

 

 

Comment
  1. Olan Knight
  2. Tuesday, 1 May 2018 18:32 PM UTC
I think your issue is with the printer. Unless your printer can handle 22"column widths on a single page, it will ALWAYS print on multiple pages.



It seems to me like the best bet would be to modify those 22" wide columns such that

1) each originally 22" column starts on a new line

2) each originally 22" column is is changed to a width of 7.5" for Portrait and 9" for landscape

3) Autoheight is turned ON for each new column



 



Olan

  1. Helpful
  1. Jason Lipman
  2. Wednesday, 2 May 2018 14:17 PM UTC
Olan,



To be clear, I am opening a PSR file, then converting that to a PDF file. So, the printer I am pointing to is the PDF printer. So all I have to really work with is the nuances of 'printing' to the PDF output. I cannot now change things in the PSR file opened in a datawindow. The PSR file does already open in the datawindow with a very wide width. I simply want to keep it that way when doing a Save As to PDF.



What I am doing is writing a little conversion utility in Powerbuilder to take in a PSR file, then Save As a PDF file. But I am struggling with the output format to PDF.



Some of these 1000's of PDF files are many years old, but still need to be retained (finance industry retention requirements), and we are moving away from a PSR standard to a PDF standard, hence the file conversion.



Jason

  1. Helpful
There are no comments made yet.
Yarannaidu Guruvu Accepted Answer Pending Moderation
  1. Friday, 22 September 2023 08:37 AM UTC
  2. PowerBuilder
  3. # 3

Hello Team,

 

How to rebuild 2017 version psr files into 2022 version ?

 

 

Regards,

Naidu

Comment
  1. Roland Smith
  2. Friday, 22 September 2023 12:52 PM UTC
The PSR file format hasn't changed in a long time so you don't need to rebuild them.
  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.