delphiprintingdelphi-xe2

Creating a virtual printer as an interface for a document management system


I would like to know if the following idea is possible/makes sense?

Create a virtual printer (like "PDF Printer" that any application with printing capabilities can see in the printers list) that doesn't print to paper or file, but simply inserts the document "being printed" in the document management system (DMS) I developed. Imagine from MSWord i choose "MyPrinter" and on "print" my custom forms appear and let the user choose where to save the doc file inside my DMS, letting the user set some parameters (related to my DMS).

So after these "forms" I have all the data needed to insert the file in the DMS.

I am aware this is somehow "in the tricks domain" but it is the only choice to integrate my app with some legacy software (with printing capability) that cannot be repalced.

I'd like to have a comment on this.


Solution

  • Creating a virtual printer is a very technical task. You will have to write a device driver, which is not directly possible with Delphi (even if there are some code in the Net).

    There are several components able to do this: they consist in an already developed printer driver, with some general API to be called from other languages, including Delphi.

    I found out that EMFPrinterPilot from ColorPilot could be a good start. Your Delphi application may be able to retrieve the Text (for indexing), PDF (for archiving) and even EMF (for display / reprint).