I noticed that you are using MFC (so, Windows). In this case, the answer will be qualified yes. In recent versions of Windows, Microsoft offers the XPS Document API , which allows you to create and process a PDF-like document using XML, which can then be printed using the XPS print API.
(For earlier versions of Windows that do not support this API, you can try to deal with the XPS file directly, but it is probably much more complicated than using CDC . Even with the API you will work at a fairly low level.)
End users can create XPS documents using the XPS print driver, which is available for free from Microsoft (and bundled with some MS products - they probably already have it in their system).
source share