Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

Open and Show a PDF on Airtap

I have seen in some apps when air tapped a button PDF window opens and user could scroll through it. Something like in this video @1.04 Inspection I tried to implement the same with this code

   var file = await StorageFile.GetFileFromApplicationUriAsync
    (
        new Uri("ms-appx:///3M.pdf")
    );


     Debug.Log("Opening file in path :" + file.Path);

        if (file != null)
        {
            Debug.Log("File found\nLaunching file...");

          //  var options = new Windows.System.LauncherOptions();
         //   options.DisplayApplicationPicker = true;
            // Launch the retrieved file
            var success = await Windows.System.Launcher.LaunchFileAsync(file);

            if (success)
            {
                Debug.Log("File launched successfully");
                // File launched
            }
            else
            {
                Debug.Log("File launch failed");
                // File launch failed
            }
        }
        else
        {
            Debug.Log("Could not find file");
            // Could not find file
        }

But am getting an ArgumentNullException
What do I need to do show a PDF within the app?

Answers

  • Options
    AmerAmerAmerAmer ✭✭✭
    edited February 2017

    I don't believe the Hololens has any native app to open that file type. You might have to create a pdf source file reader / viewer yourself or a find an open source library compiled for UWP that can be integrated. Can you convert your pdf to jpg or png? You can open those as a texture, I don't think the user will know any different that its a pdf.

    http://www.redsprocketstudio.com/
    Developer | Check out my new project blog

Sign In or Register to comment.