Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

save as PDF

Status
Not open for further replies.

rudyboy

Programmer
Oct 16, 2003
49
PH
Hi everyone,

Can I convert a datawindow to PDF in PB 6.5? I can do it in PB 9 using ghostscript but the requirement is we do it in PB 6.5. I suggested that we use powerwhizz but we need to look for other alternative.

Thanks

 
I need to convert it to PDF programatically

Thanks

 
I guess u will have to install PDF writer in ur machine which enables u to save the d/w as a PDF file
 
I have already installed Adobe Acrobat Writer, what is the next step? PB 6.5 cannot save the datawindow to .PDF because it doesnt have the PDF! option in the SAVEAS function. Is there an alternate way of saving it?

Thanks
 
It's me again :)
Adobe Writer works pretty much like a printer driver but its output goes into a file i.e. a pdf-file.

So you could simply print your dw using the pdf-printer.

 
Thanks mberni, my problem is that I need to automatically assign a filename for the datawindow that I am saving to PDF. I need to suppress the window that is asking for the filename. Is this possible? How?

Thanks

Rudy
 
This is a code-extraction of what we do, when we print into a file. I hope i didn't forget anything.

You should be fine when you play around with this a bit, because it will at least point you in the correct direction.

Code:
integer li_return, li_printed
string ls_ps_filename, ls_err

PrintSetPrinter("<Name_of_PDF_Printer>")

IF FileExists(ls_ps_filename) THEN
	FileDelete(ls_ps_filename)
END IF

ls_err = yourdatawindow.modify("datawindow.print.filename='" + ls_ps_filename + "'")

li_printed = yourdatawindow.print()

 
Hi mberni

I was able to convert it to the filename but adobe acrobat cannot open it. Error : '*.pdf' is not supported file type or the file has been corrupted

How can i solve this?

Thanks for your help


Rudy


 
Does your file actually contain something or has it length 0?

Can you probably open the file with some binary editor to find out what it contains? Maybe this could give a hint what went wrong.
 
Hi mberni,

the size is 84KB. I cannot open it but it has a file extension of .PDF

Thanks

Rudy

 
you didn't answer my question concerning the contents.

Please open the file with notepad or something like that.
The beginning of the file should look like

%PDF-

If not, tell me what you see.

Thanks.
 
Hi mberni,

I opened it in notepad this are the first few lines :

%!PS-Adobe-3.0
%%Title:
%%Creator: PScript5.dll Version 5.2
%%CreationDate: 4/7/2005 16:34:53
%%For: sicrcm
%%BoundingBox: (atend)
%%Pages: (atend)
%%Orientation: Portrait
%%PageOrder: Special
%%DocumentNeededResources: (atend)
%%DocumentSuppliedResources: (atend)
%%DocumentData: Clean7Bit
%%TargetDevice: (Adobe PDF) (3015.102) 0
%%LanguageLevel: 3
%%EndComments

%%BeginDefaults
%%PageBoundingBox: 0 0 612 792
%%ViewingOrientation: 1 0 0 1
%%EndDefaults

What is wrong with my program. I did the ff:
1. Install Acrobat writer
2. I followed your instruction re naming of the datawindow
3. Powerbuilder prompt me to remove the check "Do not send fonts to Adobe PDF" because what i am using is Postscript.

By the way, I am using PB 6.5


Thanks


Rudy


 
hehe, this is what i guessed :)

You didn't select the pdf-writer as your printer, but some Postscript-Printer instead.

So your output is a postscript-file and not a pdf.

The pdf-printer should be named "Acrobat PDF-Writer" or "Adobe PDF", depending on which Version of Acrobat you are using.

Regarding the powerbuilder Version ... since you got a file this seems not to be your problem.
 
After your last respone i took a deeper look in our code and found out that i told you something wrong.

The printer we are addressing is a postscript printer and we save the file into the "in"-Folde of adobe distiller.

Furthermore i tried out what you did and came to the same result: no pdf-file but postscript instead.

So please forget about my code, it seems not to do what you want, i regret.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top