1. Avory Rose Pastoral
  2. PowerBuilder
  3. Monday, 16 October 2023 03:20 AM UTC

Hi,

 

I am exporting pdf using the following script:

 

dw_printer.Modify("DataWindow.Export.PDF.Method = NativePDF!")
dw_printer.Modify("DataWindow.Export.PDF.NativePDF.ImageFormat = '2'")

dw_printer.SaveAs(s_newfilename, PDF!, FALSE)
dw_printer.SaveAs(s_newfilename2, PDF!, FALSE)
dw_printer.SaveAs("C:\testfolder\pdf\" + s_cpno + '_DPP_' + s_agennme + '_' + s_adver + ".pdf" , PDF!, FALSE)

 

The output is the same with how the layout look in datawindow but when I put a logo/image, the image is not displaying every time I print. Tried Distill! and installing a ghostscript too but still the image is not displaying. 

Is there a way to resolve this issue? I am using PB 12.5. Any help would be so much appreciated. Thank you.

 

 

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 17 October 2023 08:40 AM UTC
  2. PowerBuilder
  3. # 1
Comment
  1. Avory Rose Pastoral
  2. Tuesday, 17 October 2023 09:01 AM UTC
Hello, is there another way to export pdf with image without using ghostscript using pb 12.5?
  1. Helpful
  1. Andreas Mykonios
  2. Tuesday, 17 October 2023 09:15 AM UTC
Hi.

Yes. You can use any pdf printer driver like Microsoft Print to PDF (should be available in win10 & win11). But what happens if you try to save the datawindow as pdf from the IDE?

Andreas.
  1. Helpful
  1. Avory Rose Pastoral
  2. Thursday, 26 October 2023 05:23 AM UTC
Hello tried the microsoft print to pdf still its not working, the image is not displaying. Please help me.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 17 October 2023 03:02 AM UTC
  2. PowerBuilder
  3. # 2

What type of graphics file are you using (.bmp, .jpg, etc.)? PB 12.5 is quite old and very likely does not support newer formats.

Comment
  1. Andreas Mykonios
  2. Tuesday, 17 October 2023 09:17 AM UTC
I wonder if for some reason the image isn't found...
  1. Helpful
  1. Avory Rose Pastoral
  2. Wednesday, 18 October 2023 02:20 AM UTC
Hello I don't think the problem is the image. The image is properly placed inside the folder and is being path properly.
  1. Helpful
  1. Andreas Mykonios
  2. Wednesday, 18 October 2023 07:41 AM UTC
See what Chris answered and Miguel's comment at https://community.appeon.com/index.php/qna/q-a/datawindow-save-as-pdf-image-not-displaying#reply-42741. You should not be using NativePDF! To use distill! you should have ghostscrpit installed on your pc and all required settings to make it work with PowerBuilder. In case you aren't sure if ghostscript is properly setup, you can read the following document (https://infocenter-archive.sybase.com/help/topic/com.sybase.dc00844_1150/pdf/pbug.pdf). Go to page 550 (page mentioned in the book) and read what needs to be done.

Andreas.
  1. Helpful
There are no comments made yet.
Avory Rose Pastoral Accepted Answer Pending Moderation
  1. Tuesday, 17 October 2023 01:17 AM UTC
  2. PowerBuilder
  3. # 3

Hello, tried distill! too but still its not working. Can you please give me a sample? Thank you.

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 17 October 2023 10:53 AM UTC
The "distill!" option SaveAs either produces a PDF or it does not. Since you say a PDF is produced, then Ghostscript is working.

The only question seems to be the missing image. For that, I would try a different image and/or image format first. Also check the patching to the image. If that still does not work maybe try a newer version of Ghostscript.

Regards ... Chris
  1. Helpful
  1. Andreas Mykonios
  2. Tuesday, 17 October 2023 11:02 AM UTC
Hi Chris.

I would also check the size of the pdf. It should be > 0 bytes.

Andreas.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 16 October 2023 11:52 AM UTC
  2. PowerBuilder
  3. # 4

Hi Avery;

  The "NativePDF!" feature was added by Appeon. So this feature was not in the old Sybase versions like PB 12.5. 

   However, the "Distill!" option should work great with Ghostscript in PB 12.5. 

   My guess on the missing image issue could be due to an improper "path".

Regards ... Chris 

Comment
  1. Miguel Leeuwe
  2. Monday, 16 October 2023 12:45 PM UTC
Always check the return values of you Modify() statements.
  1. Helpful
  1. Avory Rose Pastoral
  2. Tuesday, 17 October 2023 01:17 AM UTC
Hello, tried distill! too but still its not working. Can you please give me a sample? Thank you.
  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.