locked
How to open / show a pdf file?

    Question

  • I want to open in our bussines app some PDF Datasheets.

    Normaly in html this goes: 

    <a href="test.pdf">Test</a>

    But this ends in error:

    APPHOST9607: The app can't launch the URI at ms-appx://640b11a9-de85-42e4-bfb6-e017384fc59d/test.pdf because of this error: -2147024846.

    APPHOST9613: The app couldn’t navigate to ms-appx://640b11a9-de85-42e4-bfb6-e017384fc59d/test.pdf because of this error: NOT_SUPPORTED.

    So how to open /show my PDF File?

    Monday, March 9, 2015 11:08 AM

Answers

  • Use file extension launcher to get the default PDF reader to open this file.

    https://msdn.microsoft.com/en-us/library/windows/apps/Hh701471.aspx


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, March 9, 2015 3:24 PM
    Moderator
  • You would have to do that using the LaunchFileAsync APIs as the OS will open the PDF file in whatever PDF viewer the user has installed.

    How to do this is described in this article: https://msdn.microsoft.com/en-us/library/windows/apps/hh452687.aspx

    Monday, March 9, 2015 3:24 PM

All replies

  • Use file extension launcher to get the default PDF reader to open this file.

    https://msdn.microsoft.com/en-us/library/windows/apps/Hh701471.aspx


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, March 9, 2015 3:24 PM
    Moderator
  • You would have to do that using the LaunchFileAsync APIs as the OS will open the PDF file in whatever PDF viewer the user has installed.

    How to do this is described in this article: https://msdn.microsoft.com/en-us/library/windows/apps/hh452687.aspx

    Monday, March 9, 2015 3:24 PM
  • this solution works perfect!
    Tuesday, March 10, 2015 11:29 AM