1. Nhan Nguyen
  2. PowerBuilder
  3. Monday, 30 January 2023 22:05 PM UTC

Hi,

I am using Powerbuilder 2019 R3. My question is:  Does Powerbuilder rely on default printer driver or any printer driver on the local computer to generate the PDF file in the following code ?

dw_1.Object.DataWindow.Export.PDF.NativePDF.UsePrintSpec = 'Yes'
dw_1.Object.DataWindow.Export.PDF.Method = NativePDF!
li_rc = dw_1.saveas(ls_tmpFileName , PDF!, true)

Thanks,

Nhan Nguyen

 

          

Berka Frenfert Accepted Answer Pending Moderation
  1. Tuesday, 31 January 2023 08:03 AM UTC
  2. PowerBuilder
  3. # 1

Neither default nor speific printer worked for me in PB 12.5. I found ghost script printer the best option for me as far as datawindow to pdf conversion is needed. All formatting worked for me.

you might want to read here

https://docs.appeon.com/pb2017r3/installation_guide_for_pb/ch10s02.html

 

My script does following (after printer ready)

TRY
    Object.DataWindow.Export.PDF.Method = Distill!
    Object.DataWindow.Printer = "Sybase DataWindow PS"
    Object.DataWindow.Export.PDF.Distill.CustomPostScript="Yes"
    
    retVal = SaveAs()
    
    IF retVal =  1 THEN
        MessageBox("RBT-DWN-SAV-AS-OK", "Document was created successfully.")
    ELSE
        /// MessageBox("RBUTDWN-SVEAS-Error", "Error: Something went wrong with Save As function.")
    END IF
CATCH(RuntimeError rteSaveAs)
END TRY

Comment
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Tuesday, 31 January 2023 07:17 AM UTC
  2. PowerBuilder
  3. # 2

Hi.

This may be a result of different dpi setting between those printers drivers... Different dpi's may have an equivalent result even when printing in paper... Have you checked those settings?

Andreas.

Comment
There are no comments made yet.
Nhan Nguyen Accepted Answer Pending Moderation
  1. Tuesday, 31 January 2023 03:52 AM UTC
  2. PowerBuilder
  3. # 3

Hi Chris,

Thank you very much for your information.  

We tested with deferent default printer driver and get different result.  If you look at the attachments,  Output_pdf1 missing horizontal line separating each row of the report,  Output_pdf2 file looks ok and the font look different for some.

Is there any way to have the PDF out put look the same for multiple users computers without having to install the same printer driver on all the computers ?

Thanks,

Nhan Nguyen

  

 

           

 

Attachments (2)
Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 31 January 2023 12:17 PM UTC
Hi Nhan;

Yes, I would expect slight variations in the PDF's between App users on different PC's with different default printers.

You're correct in that one way to maintain consistency is to make all the App users default to the same network printer but of course, this is often not practical.

However, the other alternative could be to use the PrinterGetXxxxx and PrinterSetXxxxx commands to change the PB Apps default printer "temporarily" during the PDF generation & then set the default printer back afterwards.

I believe that Engineering is currently looking at implementing a non-default printer dependent feature for a PB version in the near future.

Regards ... Chris
  1. Helpful 1
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 30 January 2023 22:18 PM UTC
  2. PowerBuilder
  3. # 4

Hi Nhan;

  Yes, all DWO's use the current default printer for fonts, layout & orientation (as you requested in the print property modification). The DW renders the screen as a bitmap image internally based on the above. Then the NativePDF feature will generate the actual PDF from that. HTH

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.