views:

135

answers:

1

Clutching at straws here, I think I remember seeing a solution to this somewhere but can't find it now.

The issue is that I need a Windows application (not .Net) to be able to generate PDFs. The "standard" solution is to use something like PDF995 or CutePDF which create a dummy printer that your application can then print to and it is redirected to a PDF file. The problem is that to control those printers requires updating INI files or registry keys and that is error prone and often runs into concurrency problems.

Building the PDF file programmatically isn't an option, it needs to be able to take the output that would normally be sent to a printer, or possibly convert directly from an Excel file.

Ideally, I'd just pass the Excel file to a COM/ActiveX object and it would write to a file I specify. Next best option would be for it to create a separate printer per print job or have some reasonable way of guaranteeing the filename I give will have the document I print.

This Excel to PDF Batch converter might do the trick as at least it has a command line mode, has anyone tried that? It would only solve the problem for Excel files though.

So, is there a better solution?

(As a side note, for Visual FoxPro reports XFRX works really well, it converts the report directly to a PDF without needing a printer driver.)

+1  A: 

You might want to look at BullZip (google it because I cannot add hyperlinks yet). We recently had Jody Meyer present this tool at the Detroit Area Fox User Group (previously shown at the Grand Rapids Area Fox User Group too). It was a great session.

She showed how to use the COM object to automate a ton of the BullZip features including the name of the file and properties like author and keywords. Watermarks are a snap too. It is simple and straightforward and her example was rock solid. Tons of features already done for you so you can simply re-engineer the demo form.

You can download it on the DAFUG Web site, in the downloads folder. File name is BullZipDemo.zip (google Detroit Area Fox User Group) and add the folder and filename.

Rick VFP MVP

Rick Schummer
Thanks Rick, found this: http://www.bullzip.com/products/pdf/info.phpDocumentation here http://www.biopdf.com/guide/examples/batch_printing/ suggests that they handle the concurrency issue by having a "one shot" runonce.ini settings file, so looks like it might be worth a try.
Tom