Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Saving a VFP-generated WordDoc to PDF
Message
From
21/12/2010 10:36:02
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Miscellaneous
Thread ID:
01493216
Message ID:
01493486
Views:
86
>>I need to Save / PrintToFile a VFP-generated MSWord doc to a PDF file. I need to be able to specify the PDF filename. Cannot rely on the presence of certain versions of MSWord or MSOffice on the machine. Cant assume the user already has a PDF printer installed. Need to deploy functionality via an installer... which i'm sure is a pain in the arse with windows rights issues when attempting to install PDF printers via a setup process.
>>
>>Anyone doing something like this with GhostScript, cutePDF's SDK, etc... ? Thanks.

Sorry, missed this - finally had to close Firefox and then lost a few messages when I reloaded.

There's Print2PDF in downloads, which you can use as a starting point. It basically requires you to install a PostScript printer driver and GhostScript (both included, but you better get the latest GS). It was designed to work with frx reports, but it takes only a couple of hours or days to get it to work with Word - you basically need to tell Word to temporarily set the PS driver as default, then print into file, pass that .ps file to GS and let it convert to pdf. The main trouble will be the Word itself, because it may have near impossible settings (if you hide dialogs then other dialogs may pop up which otherwise wouldn't, it may complain about margins etc etc) and some of the code is different between W2003 and W2007... and then if your code saves the generated documents as .doc, they may be .docx inside if your user has installed W2007 without telling you etc etc.

How's VB these days?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform