Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a PDF with Fox 2.6
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00206598
Message ID:
00206756
Views:
24
>I've read several of the threads dealing with creating PDF's from a Fox report. I understand that I need to get the driver from Adobe. After that is done, and after I install it...
>How do I send the results there IF:
>1. The PDF driver is NOT my default printer
>2. I do not want the PDF driver to "permanently" become my default printer (setting it temporarily and returning to my original state would be acceptable)
>3. I'm on NT (server and workstations)
>4. I want to specify the name of the resulting file via my program (dynamically)
>5. I want no user interaction in the process after the click print
>
>After the PDF file is created I may want to email or fax it at some time in the future, as a result the naming has to be at run time to avoid over-writting previously written files.
>
>I've heard that this is a piece of cake, but my boss wants to be sure. Are there any "glitches" I should look out for?
>
>Rick Liebespach
>RLiebespach@OmniaGroup.com

Rick- you won't be able to use the class directly (2.6 and all) but you should download and look at Rick Strahl's wwPDF class.

It turns out that the Adobe printer driver is extremely programmer unfriendly:
you can't directly set an output file name, you have to set it in an ini file before ou print. This can also cause contention if the pdfs are being created automatically like on a web server.

Rick's class takes care of a lot of the logic of setting and restoring the printer driver, using the SetProfileString API function to work with the adobe ini file, and implementing a Semaphore locking scheme to avoid contention.

Like I said, you won't be able to use the class directly, but you should be able to look at the code it uses to get you pointed in the right direction.
-
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform