user1519082
user1519082

Reputation: 33

How do I get a DataWindow to save correctly to PDF?

Here's my problem. I currently am trying to print a DataWindow to a PDF file in PowerBuilder 12.5. I got some code, and it currently looks like this.

//dw_1.Modify("Datawindow.Export.PDF.Method = Distill! ")
//dw_1.Modify("DataWindow.Export.PDF.Method = XSLFOP! ")
dw_1.Object.DataWindow.Export.PDF.Method = Distill!
//dw_1.Object.DataWindow.Printer = "\\prntsrvr\pr-6"
dw_1.Object.DataWindow.Export.PDF.Distill.CustomPostScript="No"
dw_1.SaveAs("c:\dw_one.pdf", PDF!, false)

I installed GhostScript on the machines, but I read at some places that I would need to create a new printer and set some drivers in the PB driver directory. Could anybody enlighten me?

Upvotes: 1

Views: 13305

Answers (2)

Muhammad Saeed
Muhammad Saeed

Reputation: 81

install do pdf8 along with ghost script. it will ask you during the run time to save it as pdf . click ok and after waiting of approx 2 mins it will convert your data window as pdf. for more details watch this video https://www.youtube.com/watch?v=BfuV7a_4ONU

Upvotes: 1

Carl Wyles
Carl Wyles

Reputation: 31

I just did this myself.

you want to install ghostscript http://www.ghostscript.com/download/gsdnld.html and have the right one for your OS (32bit vs 64bit) I used the 9.02 version myself

You install it as an administrator for the machine, and the installer program should auto generate the "Sybase Datawindow PS" Printer device for you.

Once that is done you don't have to set any thing in the datawindow for for it to work, the defaults are ok

Just do: dw_1.saveas( "c:\somefilename.pdf", PDF!, false ) and viola! a pdf

Upvotes: 3

Related Questions