1. Andy Preman
  2. PowerBuilder
  3. Wednesday, 3 February 2021 20:19 PM UTC

Hello,

Just migrated to 2019 R3 from 2019 R2 and I found an issue when exporting a report to NativePDF.  This worked correctly in 2019 R2.  Now in R3 when I export a report to PDF where the printing is right up to the right margin but not over it, it gets cutoff and prints on a second page (see attachment).  If i preview and print the report to a printer it works correctly.  If I preview and export with NativePDF about 1/4 inch of the printing prints on a second page.  I tried using multiple printers with the same issue, however I tried switching the printer to 'Microsoft Print to PDF' and then the export using NativePDF worked.

Has anyone else had this issue?

Also I do have UsePrintSpec = 'Yes'

Thanks,

Andy

 

Attachments (1)
Andy Preman Accepted Answer Pending Moderation
  1. Thursday, 4 February 2021 15:25 PM UTC
  2. PowerBuilder
  3. # 1

John,

After playing with different combinations, I believe I have solved the issue.  In print specifications of the datawindow, the paper size was set to default.  We have always left that as default and never had an issue before.  As an experiment I switched it to Letter 8 1/2 11 in (1) and in combination with checking 'Use Paper Size and Orientation Settings from Print Specifications' on the Data Export tab, this solved the problem and the NativePDF exports are now working correctly.

I am also including a very simple sample srd you can import.  You can do an insert row to add a couple of lines of data.  This srd was created in R2, so you will need to migrate it.  Try leaving paper size as default and you should be able to recreate the problem.

 

Andy

Attachments (1)
Comment
  1. John Fauss
  2. Thursday, 4 February 2021 17:02 PM UTC
That's fantastic, Andy! Congratulations!

You can turn on the "UsePrintSpec" setting for NativePDF via code rather than having to make a cleanup editing pass through all of your DataWindows. Look at the Help topic named "Export.PDF.NativePDF.UsePrintSpec" in the PB Help. There are some other settings documented there you may find useful. Best wishes, John
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Thursday, 4 February 2021 17:19 PM UTC
Thanks for sharing the solution!
  1. Helpful
  1. mike S
  2. Wednesday, 2 June 2021 18:04 PM UTC
thanks andy, i just ran into the same exact problem. I have central code that sets all sorts of things, so setting paper size to 8.5x11 when it is set to default paper size is an easy work around for my code.



my guess is that appeon changed the PDF stuff and forgot that pdf that they use assumes different default paper size (A2 i think?). I'm just super glad we found the bug before we shipped it to our customers.



I had hoped the latest build of 2019R3 fixed it, but it did not.





  1. Helpful
There are no comments made yet.
Andy Preman Accepted Answer Pending Moderation
  1. Thursday, 4 February 2021 14:06 PM UTC
  2. PowerBuilder
  3. # 2

John,

I did what you suggested and compared PDF prints between the R2 version that works correctly and the R3 version with the issue.

The problem is the left margin, in the R2 version the left margin is .25 which is correct.  In the R3 version the left margin is .4375. So the whole report is being shifted to the right and the the overflow is on a second page.

If I hold the 2 pages together and shift one of them so the print lines up, everything overlays correctly, so it does not look like a font issue.  FYI - I am using embedded fonts.  There are 3 fonts in this report, Arial, Arial Bold and Arial Narrow.

Keep in mind that this worked correctly in older versions of Powerbuilder with Ghostscript and 2019 R2 with NativePDF.

Previews and printout are still working correctly, it is just the export with NativePDF that shifts everything over. I tried this with 3 different printers 2 HP and 1 Cannon and I get the same result with all of them.  Printing OK NativePDF not OK.

The only way I can get the NativePDF export to work correctly is to switch the default printer to 'Microsoft Print to PDF'

 

Andy

 

Comment
  1. John Fauss
  2. Thursday, 4 February 2021 15:05 PM UTC
Interesting. It does sound like the issue is limited to the left margin, then. Glad to hear that font-related factors are not entering into the mix, so this test was useful to tell us that much, at least.

Does the problem occur for anyone/everyone, or just you? Is there any change in the PDF if you reduce the left margin setting in the DataWindow (I'm not advocating changing all DW's, I'm just suggesting things to help troubleshoot what might be affecting the behavior)? Is it just Landscape orientation? Does this happen if the print job is a single page or only when multiple pages are being generated?

I wish I had a quick/easy fix, but it looks like a bug at this point. Can you produce/save a PSR that does not contain any sensitive or proprietary information that you could then zip and attach in a new reply in this thread? If so, I could try it on my system.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 4 February 2021 04:43 AM UTC
  2. PowerBuilder
  3. # 3

Hi, Andy - 

When NativePDF first became available, we noticed similar behavior between output produced with NativePDF and that produced by GhostScript, which we had been using in prior versions of PB.

Can you still create a PDF using 2019 R2? What we did to determine where the minute differences were was to take printouts of the same page of identical data produced in GhostScript and NativePDF and hold them up to a light source with a page from one version on top of the same page from the other version. We could see if the differences were due to margins, font size, character spacing, etc., or combinations of these and other factors.

I'm curious if you have done something similar and if so, can you categorize the difference(s)? Obviously there is some difference, in order for the output to spill over onto a second page.

If things work OK when switching to a different printer, as you described, it make me wonder if the issue is related to the font(s) that are available to the various printers. Are you seeing this issue with many or all reports/printouts or only a few, select ones? What font(s) do the ones that fail use?

Regards, John

Comment
There are no comments made yet.
Andy Preman Accepted Answer Pending Moderation
  1. Wednesday, 3 February 2021 20:49 PM UTC
  2. PowerBuilder
  3. # 4

Chris,

All I did was migrate to R3, no other changes.  I will open a support Ticket.

FYI - It behaves like an inkjet printer where the right margin is wider than a laser printer.

Thanks,

Andy

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 3 February 2021 20:40 PM UTC
  2. PowerBuilder
  3. # 5

Hi Andy;

  If this worked 100% in R2 and you have not changed your App's code or PDF properties - then please, open a Support Ticket for this issue. Also if you can, please provide a simple test case as well and attach it to the ticket. Many thanks in advance!

Regards ... Chris

 

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.