PowerApps PDF Viewer – WORKING Solution!

In previous posts, I have mentioned how much I like using PowerApps and for the advanced IW/part-time entry-level dev, it is a super-powerful platform.

One of the features I have wanted to use is the PDF viewer.  Now, you will notice within PowerApps this is listed as an experimental feature.  A quick Bing search and you will see that a lot of people have had issues getting the functionality working.  Indeed, I myself have had this problem as well, where the only option I had to display my PDF was in a browser, outside of the PowerApp.

Reading the documentation, it is a little ambiguous – it says you need to reference the file via HTTPS then the example shows HTTP.  After some testing, this is a working solution and whilst it may not work for all – I am sure it will work for many.

Things You Will Need

A CORS-enabled service – I am using a free DropBox solution

Step 1:  Save Your File To DropBox

Save your PDF file to dropbox.  I used the web version as you will need to share the document to obtain the link.  Copy the link to your clipboard

Step 2:  Manipulate The Link

You will need to replace the http://www.dropbox.com at the begining of your link to dl.dropbox.com.  The rest of the URL can remain the same

Step 3:  Add The Code To PowerApps PDF Viewer

In your PDF view, select the Document property.  You will need to place the URL you created in Step 2 within quotation (“) marks.

In the example below, I am rendering a boilerplate PDF file:

TripReportViewer

The PDF file should render nearly instantaneously!  The solution can be made even more powerful – if you do not want to hard-code a PDF file, you can leverage a gallery and selected item to retrieve the PDF URL from your source (in my case – SQL Azure; with a field called DropBoxTripReportURL) where you can add the link.  Please reach out if you want more details on that solution (or I will blog in the future).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s