Anybody familiar with the details of implementing a virtual printer? RRS feed

  • Question

  • Hello, all.

    We need to implement a virtual printer similar to the legendary one by Adobe. The images processed by it will be detailed CAD drawing. I am told that for this purpose it is best to use the EMF format for input. My output will be DXF.

    I already have a couple libraries that read and write DXF files, so I am all set with the output phase. My concern is what to do when I receive the EMF "file" that the application will send me. I guess that I will have to develop/find some sort of "EMF interpreter" or "EMF Virtual Machine", somehow decode the line segments and write them to the DXF output.



    Thursday, October 11, 2012 5:40 PM


All replies

  • It seems that EMF is essentially the same thing (or closely related) as GDI. Is that correct?

    Is there a EMF+ which is associated with GDI+??


    Thursday, October 11, 2012 5:46 PM
  • It is just a bunch of GDI commands, you can open the EMF file via the meta file explorer and see the records. There's a GDI+ based version called Enhanced Metafile Format Plus Extensions.

    Visual C++ MVP

    Thursday, October 11, 2012 8:51 PM
  • Please see this very relevant whitepaper. GDI drivers are not the way to go.

    Thursday, October 11, 2012 10:53 PM
  • Thanks for your kind answer, Justin. The virtual printer I need is the only way to extract some images from an ancient, unsupported software. The last thing I need in this project is Windows 8.

    I can persuade that app to send its GDI+/EMF+ images to a printer, nothing else. This is a temporary solution.


    Thursday, October 11, 2012 11:25 PM
  • Thanks, Sheng...

    Where can I download the Meta File Explorer?


    Thursday, October 11, 2012 11:49 PM
  • With due respect to some "Owner" who marked it as Answer, the above IS NOT AN ANSWER to MY QUESTION.

    Silly me, I assumed I was the owner of my questions.

    Friday, October 12, 2012 7:35 AM
  • I think maybe what one of the earlier posters was trying to get at when he suggested not to write a GDI printer is that maybe you should look at developing a XPSDrv driver. Is it easier for you to convert from XPS to DXF? If not then ignore this suggestion! :)

    If it's the same or easier, XPSDrv drivers have the advantage that you don't have to develop a whole driver, just a couple of plugin libraries based on what you need (i.e. a renderer, UI or filter library (the filter would be where you do the conversion for XPS to DXF)). Also, XPSDrv drivers are backwards compatible to XP SP2. If you need earlier OSs then again, it's probably not a useful suggestion!

    Ah well, hope it gives you a bit more to look at! (I know driver development can be a painful thing at best!)


    (Don't worry, I won't propose this as an answer!) ;)

    • Edited by Andrew Cardy Thursday, November 10, 2016 3:15 PM
    Friday, October 12, 2012 8:03 AM
  • No

    Thursday, November 28, 2013 3:59 AM