locked
Render XPS Document

    Question

  • I want to render XPS documents in my c++ Metro-Style app. I looked into the spec. (http://msdn.microsoft.com/en-us/library/windows/desktop/dd316975%28v=vs.85%29.aspx) and on the Internet and could only find managed code solutions (via DocumentPage). The native APIs/samples only cover how one modifies and prints the documents.

    Is there any way to "display" (render to screen) a XPS in Windows ?

    Thanks,

    Paul

    Tuesday, February 7, 2012 10:53 AM

Answers

  • Hi Paul,

    I just found some COM API for XPS document for Metro style App, and the XPS Document Interfaces contains most of them. I hope this document can help you:
    http://msdn.microsoft.com/en-us/library/windows/apps/br205760.aspx

    Best regards,
    Jesse


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

    • Marked as answer by Bob_Bao Wednesday, March 7, 2012 6:42 AM
    Wednesday, February 8, 2012 12:07 PM
  • Hi Paul,

    What sort of application are you writing? There is no Windows.UI.Xaml way to render an XPS (similar to WPF's System.Windows.Document classes).

    In a Direct2D app you could use the XPS Document interfaces that you and Jesse referenced to iterate the OM and render them yourself, but I don't believe there is a more direct way to render the XPS.

    If you have an XPS file then you can launch it in its default viewer with LaunchDefaultProgramForFile.

    --Rob

    • Marked as answer by Bob_Bao Wednesday, March 7, 2012 6:42 AM
    Thursday, February 9, 2012 12:46 AM
    Owner

All replies

  • Hi Paul,

    I just found some COM API for XPS document for Metro style App, and the XPS Document Interfaces contains most of them. I hope this document can help you:
    http://msdn.microsoft.com/en-us/library/windows/apps/br205760.aspx

    Best regards,
    Jesse


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

    • Marked as answer by Bob_Bao Wednesday, March 7, 2012 6:42 AM
    Wednesday, February 8, 2012 12:07 PM
  • Hi Paul,

    What sort of application are you writing? There is no Windows.UI.Xaml way to render an XPS (similar to WPF's System.Windows.Document classes).

    In a Direct2D app you could use the XPS Document interfaces that you and Jesse referenced to iterate the OM and render them yourself, but I don't believe there is a more direct way to render the XPS.

    If you have an XPS file then you can launch it in its default viewer with LaunchDefaultProgramForFile.

    --Rob

    • Marked as answer by Bob_Bao Wednesday, March 7, 2012 6:42 AM
    Thursday, February 9, 2012 12:46 AM
    Owner