Naar hoofdinhoud gaan

Pdf Viewer

Daniel Sallander

This visual utilizes PDF JS to display PDF documents from base64 encoded strings.

This visual utilizes the PDF JS javascript library (https://mozilla.github.io/pdf.js/) to display PDF documents from base64 encoded strings.

The visual reads pdfs from the Power BI data model which requires the documents to be converted into base64 encoded strings before imported into the data model.

The visual is restricted to display one pdf at a time and will display a warning otherwise.

With one document selected the Pdf Viewer displays pdf documents with controls that enables the user to switch pages and zoom in and out. On the format pane there are also possibilities to show/hide header controls and overflow scrolling.

It is most suitable to use with small document since columns in tabular models can contain maximum ca 30.000 characters.

The workaround for files that require more characters is to split the strings into multiple columns on import and concatenate them back to their original form in a computed column (see example pbix file).

Sample pbix contains two examples:

  • Example 1: Showing two pdf documents with multiple pages.
  • Example 2: Showing table with invoices which displays pdf on hover and possibility to drillthrough for full pdf document. This example has the scroll bar option and header option disabled for the hovered pdf.

Known issues:

  • There are some compatibily issues with Internet Explorer 11 and earlier
  • If other zoom than 100% is selected it will be reset to 100% when switching pages
Mogelijkheden van invoegtoepassing
Wanneer deze invoegtoepassing wordt gebruikt, kan deze
  • Lezen en wijzigingen aan uw document aanbrengen
  • Gegevens via internet verzenden
  • https://az158878.vo.msecnd.net/marketing/Partner_21474848609/Product_42949682754/Asset_c65c92d0-a427-42a6-8895-a5501c7e1318/Screenshot1.PNG
    https://az158878.vo.msecnd.net/marketing/Partner_21474848609/Product_42949682754/Asset_c65c92d0-a427-42a6-8895-a5501c7e1318/Screenshot1.PNG
    https://az158878.vo.msecnd.net/marketing/Partner_21474848609/Product_42949682754/Asset_e33d88ab-3d72-49c7-8254-30c76bb73f2d/Screenshot2.PNG