locked
Printing an XPS Document from the Metro App

    Question

  • Hi,

    I need some guidance:

    We have used the XPSOM interface to create XPS documents from shared content.

    http://msdn.microsoft.com/en-us/library/windows/apps/br205760.aspx

    Works great but now we need to print those documents to our own  “print to file” V4 printer driver.

    We have the content in XPS which is the printer spooler file format for our V4 printer driver but I can’t find a way to give the XPS file to the Metro print subsystem.

    There are print APIs on the same page as the XPS document APIs (see link above), however I can see how to link the APIs together. Can anybody help?

    To recap I want to send an XPS file that I have created to a V4 printer driver.

    • Moved by Jesse Jiang Thursday, May 31, 2012 7:22 AM (From:Building Metro style apps with C++ )
    Wednesday, May 30, 2012 8:18 PM

Answers

  • Hi Eric,

    I think I understand what you're getting at. You have a Metro style app with XPS content, and you'd like to print that content to file via your v4 driver. Is that correct?

    Metro printing all must go through the Metro print dialog. In general, users initiate this action via the devices charm, though, in some cases, the app can invoke the devices charm on the user's behalf (eg when an HTML5 app calls window.print()). We've got an SDK sample that shows how to handle printing from many programming languages. http://code.msdn.microsoft.com/Print-Sample-c544cce6 If you were hoping to pick your printer out of the list automatically, however, that is not a supported scenario.

    Thanks!

    Justin

    Monday, June 11, 2012 10:27 PM

All replies

  • Hi ,

     

    I think your issue should be raised in the Tailoring your Metro style app for hardware and devices . I believe they will know more information of this issue than us, and I will move this one to that forum.

     

    Thanks for your understanding,

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, May 31, 2012 7:23 AM
  • demonblade,

    I will look into this for you.

    Best Wishes - Eric

    Thursday, May 31, 2012 6:27 PM
    Moderator
  • Hi Eric,

    Thanks, we have a release at the end of June and it would be really useful to have that information in the next week or so.

    Kind Regards,

    Eric (demonblade).

    Monday, June 04, 2012 2:00 PM
  • Eric,

    We have a whitepaper that covers how to build a print to file driver. http://msdn.microsoft.com/en-us/library/windows/hardware/hh770510 . 

    Best Wishes - Eric

    Monday, June 04, 2012 5:37 PM
    Moderator
  • Hi Eric,

    I have read that whitepaper ( a few times :)  and it dosn't asnwer my question. To recap I want to know how to send an XPS file that I have created to a V4 printer driver.

    Eric

    Monday, June 04, 2012 6:05 PM
  • Hi Eric,

    I think I understand what you're getting at. You have a Metro style app with XPS content, and you'd like to print that content to file via your v4 driver. Is that correct?

    Metro printing all must go through the Metro print dialog. In general, users initiate this action via the devices charm, though, in some cases, the app can invoke the devices charm on the user's behalf (eg when an HTML5 app calls window.print()). We've got an SDK sample that shows how to handle printing from many programming languages. http://code.msdn.microsoft.com/Print-Sample-c544cce6 If you were hoping to pick your printer out of the list automatically, however, that is not a supported scenario.

    Thanks!

    Justin

    Monday, June 11, 2012 10:27 PM