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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating creation of PS file with Distiller

Status
Not open for further replies.

CSolids

Programmer
Nov 1, 2003
3
0
0
US
I am trying to programatically automate creation of PDF's through Distiller by the 2-stage process of

1. Creating a post-script file by doing a print to file from the application with "Acrobat Distiller" as a printer (giving the file a ".ps" extension). then
2. Using the FileToPDF method off the Distiller object to convert the .ps file into .pdf.

My problem seems to be in creating the post-script file in the first place because the Adobe PDF settings for the Distiller "printer" keep re-setting to check "Do Not send Fonts to Distiller" which aborts the whole process. I try manually unchecking this, and then all works well until the application closes, another printer is used, etc. Then everything resets to its default value of not sending fonts to Distiller. This is something I really want to handle behind the scenes so that the users are not confronted with re-setting their printer properties every time this functionality is used. I cannot find answers to this in the Adobe Acrobat SDK, but maybe I'm missing something??

If anyone has experience with this or insights into how the printer settings can be changed behind the scene I'd love to hear from you. I did not find any promising-sounding headings or keys in the registry, but maybe there are some things that don't show up until there's a setting for them?

Thanks in Advance!
 
Csolids -

I ran into this once a long time ago, and I _think_ (sorry for the hedging) that it's a matter of _how_ you reached the dialog box to change the setting. If you go in straight from Distiller itself, your change is only temporary. However, if you go to Start, Settings, Printers, and configure the Acrobat Distiller "printer" there in what _appears_ to be the same dialog, then your settings are actually saved.

Regards,
John Hinds
 
John,

You're right! Kind of quirky that the settings "stick" from one access point and not from another. Thanks for the tip. Seems like something Adobe should have mentioned.

Thanks for the response,
--Brenda
 
Question to CSolids:
I have large number of .ppt documents that I need t programmatically convert in .pdf format and, not only that but I need to only convert a first page of each .ppt into .pdf. Do you by chance know how to do it? Please share some code example if you have it available.
Thank you.
20132
 
I believe powerpoint also has a "printout" method off of the active document object that you can use to print to file.

You may need to first set Distiller to be your default printer. Then print to file. Then use distiller's method of FileToPDF, bare bones of which are below:

dim pdfDist as PdfDistiller
Set pdfDist = New PdfDistiller
pdfDist.FileToPDF sFileIn, sFileOut, ""

(You'll need to include "Acrobat Distiller" in you project references to use this.)
 
CSolids,

Thank you very much for your help. However, I was not able to make it work.
First of all with Acrobat 6.0 you don't have an option to default to Distiller; you can only default to Acrobat PDF and I do not know if this is causing a problem. Second, I am not sure what I am suppose to pass as Joboptions parameter (third argument in FiletoPDF method). Here is what I've done so far:
I've produced .ps file via "Printout" method first,
now my line of code (that does nopt produce anything) looks like this:
pdfDist.FileToPDF sFileIn.ps, sFileOut.pdf, ""
Could you help me with creating a pdf file?

Thanks again.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top