1. David Haas
  2. PowerBuilder
  3. Tuesday, 31 March 2020 16:56 PM UTC

Hello,

Just recently changed SaveAs PDF using Ghostscript to using Native PDF as below:

    lds_report.Object.DataWindow.Export.PDF.Method = NativePDF!
    li_rtn = lds_report.SaveAs(ls_report_filename, PDF!, false)

Reports are saving to PDF OK except that now there's blank page every other page where there wasn't before.

Has anyone had this or know of this issue?  Currently using PB 2017 R3.

Thanks in advance for any assistance!

Dave

Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 3 February 2021 10:35 AM UTC
  2. PowerBuilder
  3. # 1

Hi Dave, 

 

Is your issue resolved?

Have you tried John Fauss's suggestion to set the UsePrintSpec=Yes property?

Or tried Mike S's suggestion to add code 'DataWindow.Export.PDF.NativePDF.UsePrintSpec = Yes' before you execute the SaveAs function? 

https://docs.appeon.com/pb2019r3/datawindow_reference/ch03s03.html#XREF_19761_Export_PDF_NativePDF_UsePrintSpec

 

Regards,

 

Comment
There are no comments made yet.
Erick Bergsma Accepted Answer Pending Moderation
  1. Monday, 1 February 2021 17:52 PM UTC
  2. PowerBuilder
  3. # 2

Dave... did you find a solution for this?

I am converting existing text based documents to PDF, and I'm running into an issue where the report should easily fit on one page... but is coming as 2.

I have a main Composite report that consists of several other reports

Tthe first page on the report does seem to have a large gap, but then the 2nd page only has the header and footer.

I've played with Margins and the Width of the composite setting and also the contents of the reports in the Composite report.

I am using the following to do the SaveAs...

When i adjust the Margins, I can see the report "move", but it is still 2 pages.

Can you comment on  the fix you made... if there was one...

 

 

Comment
  1. Mark Lee @Appeon
  2. Wednesday, 3 February 2021 10:28 AM UTC
Hi Erick,



Can you tell us which PB version you are using?

When you use NativePDF to export the PDF file, there are defects if you adjust the Margins property in the PB 2017 versions. Have you tried it in PB 2019 R3?



Regards,
  1. Helpful
  1. Erick Bergsma
  2. Wednesday, 3 February 2021 13:26 PM UTC
Thanks Mark...

We are on PB2017 R3 Build 1880. I can't really take the step into PB 2019 at this point. There are too many of us here, and going that migration will be a lengthy process. It took over a year to get everybody from PB 9.02 to PB 2017.

However... here is what I did, which seemed to point to the resolution...

Went to PB 2017 R3 Build 1915, and rebuilt the composite report. That seemed to resolve the issue.

I went back and compared the source for the old version and the new version.

The new version had set ...

- NativePDF.UsePrintSpec to yes, the old report was no

- added Height.Autosize = yes. the property did not even exist in the old report

I can only conclude that one of these properties corrected the issue.

Moving up to Build 1915 should be something I can convince everyone to do.



Thanks again!!

  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 31 March 2020 18:27 PM UTC
  2. PowerBuilder
  3. # 3

Hi, David -

Mike S is correct. If you don't explicitly set the paper size for NativePDF in the Data Export tab of the DW Painter, or you don't define (in the DW Painter) or set the UsePrintSpec=Yes property, the default paper size is A4, which causes a "page overrun" to occur for every page when printing on 8.5x11.

You can see this in the Help in the topic: Export.PDF.NativePDF.CustomSize property (DataWindow object). The documentation on the UsePrintSpec property is listed three topics further down.

We struggled with this mightily when PB 2017 R1 was released, as the "UsePrintSpec" property did not yet exist.

HTH, John

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 31 March 2020 17:08 PM UTC
  2. PowerBuilder
  3. # 4

Hi Dave;

   Can you tell us ...

1) What build of R3 are you using?

2) Have you tried this from a DW Control vs a DS?

3) Have you tried changing the "Default Printer" before the SaveAs() command?

4) What version & build of MS-Windows are you using?

Regards ... Chris

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 31 March 2020 17:06 PM UTC
  2. PowerBuilder
  3. # 5

You might have an object too close to the right margin.

Comment
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Tuesday, 31 March 2020 17:04 PM UTC
  2. PowerBuilder
  3. # 6

this is due to difference is the default margins .  review all the settings available to you.

especially this one: DataWindow.Export.PDF.NativePDF.UsePrintSpec = Yes

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.