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

Converting TIFF files to PDF

Status
Not open for further replies.

blampione

Programmer
Jun 24, 2005
2
US
Hello...

I am new to this forum and have a question. This may have been covered already, but I searched and found nothing.

I would like to programmatically open a TIFF file in Acrobat and save it as a PDF. I have the Adobe Acrobat 4.0 full version. Any ideas would be greatly appreciated.

 
Try these resources:
thread1251-899286 has a link to a Mike Stewart article that tells you how to run Acrobat and open a file from within Visual Foxpro.

thread1251-989739 tells you how to automate the creation of a pdf file from VFP using the PDFWRITER printer driver, which worked in Acrobat v5 but not later versions. I don't know if it works in Acrobat 4.

If it is possible to open a TIFF file directly with Acrobat 4, these should get you started.

Mike Krausnick
Dublin, California
 
Thanks for the links, Mike, but they do not really help. We already have a function that sets PDFWriter as the default printer, so that we can print to a PDF. I tried using that in combination of the ShellExecute (where I first set the printer to PDF and then print the TIFF file), but that only opened the TIFF file. Below is the code I used:

*****************************************************
PARAMETER tcInFile, tcOutFile

*-set printer to PDFWriter w/ filename specified
=SetUpLPT("PDF1", '',tcOutFile)

*-print passed in file to the PDFWriter -*
DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin

ShellExecute(0, "print", tcInFile , "", "", 1)

******************************************************

I even tried passing 0 as the last parameter for ShellExecute, but it still didn't work.

I would really like to use an Adobe object. I tried using acroexch.document, acroexch.pddoc and acroexch.AVDoc....but I am not familiar enough with them and the commands I need to use.

Is anyone familiar w/ any of these interfaces enough to show me how to (1) open/load a TIFF file and (2) save the PDF?

Thanks again for your help. I did get an answer to another issue I was having because of these links [thumbsup2]


 

Blampione,

When I first saw your post, I wondered about suggesting you use ShellExecute(), but I realised that it wouldn't work -- as you have found. The problem is that you are using VFP to set the PDF writer as the default printer, but of course the ShellExeucted application knows nothing about VFP's printer settings.

I guess the only way this approach would work is if you could first go into the application that prints the TIFF, and sits its default printer to the PDF writer. I'm sorry I can't tell you how to do that.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top