Can it be used as a "real" printer from delphi?

  • I know I can use it to generate PDFs from code as if it where a printer, with its canvas, but my questions is if I can make something like this:

    1) From delphi, I make wPDF as the default system printer.
    2) Then open a excel (form code) and make excel send it to the default printer.
    3) Recover this PDF from the printer as if it were delphi who painted on it, like if the printer internal stream containng the PDF created were usable from delphi (not using external files if possible).

    The goal is to convert xls document to PDF on the fly, from delphi, and may be the steps propose are not the good way, any usefull way could be ok to me.

    My best bet this far is to use a PDF printer and controllig its behaviour via the windows register so I can know where will the printer store this PDF and so I can silently wait until the file is there ready to load fom the delphi side.

    But this approach is not very clean, as if several access the system using terminal server, all of them can be creating those PDF files in the same tmp dir at the same time, so the register may be not a good choice if several can "confuse" the system and mix the files.

    • Offizieller Beitrag

    Hi,

    sorry, this approach does not work with wPDF. It is no printer driver, just a conversion engine which basically converts metafiles to PDF pages.

    Since it works with metafiles it can export various contents, but it cannot capture the output of a different EXE.

    Julian