1. Pacito Nefulda
  2. PowerBuilder
  3. Friday, 31 May 2019 12:13 PM UTC

Hello,

I'm trying to save a simple list datawindow to a PDF but keep on getting a result of -1. Thanks

Here is the script I created:

 

long ll_return
integer pdfstandardindex = 1


dw_1.Object.DataWindow.Export.PDF.NativePDF.PDFStandard = pdfstandardindex - 1

ll_return = dw_1.SaveAs( 'c:\temp\testdata.pdf', PDF!, true )

If ll_return = 1 then
messagebox('SaveAs', 'File successfully created in c:\temp...')
else
messagebox('SaveAs', 'Creating File in c:\temp failed... = ' + string(ll_return) )
end if

 

Scott Mason Accepted Answer Pending Moderation
  1. Friday, 31 May 2019 15:25 PM UTC
  2. PowerBuilder
  3. # 1

I was having a similar problem then added

This.Object.DataWindow.Export.PDF.Method = NativePDF!

I think the default PDF export uses Distill!

 

Comment
  1. Chris Pollach @Appeon
  2. Friday, 31 May 2019 19:25 PM UTC
Hi Scott;

You are correct ... "Distill!" is the default DWO PDF option upon creation. So unless you change the PDF option to NativePDF! (either in a DW Modify, DW Painter or set the defualt in PB.INI) the SaveAs() would fail (aka -1 ) if GhostScript was not installed.

Regards ... Chris
  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.