Skip to content

Instantly share code, notes, and snippets.

@robcarmona
Last active September 25, 2021 23:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robcarmona/1a9b339a24c7d7e3b9b9e02086d6fac5 to your computer and use it in GitHub Desktop.
Save robcarmona/1a9b339a24c7d7e3b9b9e02086d6fac5 to your computer and use it in GitHub Desktop.
Ionic Android PDF Viewer

Below are options for android pdf viewing. Android does not have a native pdf viewer but there are options with tradeoffs. In all cases, pdfs would need to be temporarily stored unencrypted (we can delete this file once we are done viewing)

InAppBrowser

Uses google docs to view (https://docs.google.com/gview?embedded=true&url='')

  • πŸ‘ zoom in/out functionality
  • πŸ‘ able to hide url navigation bar
  • πŸ‘Ž pdf's must be online

Pdfjs (Ng page viewer)

bare bones viewer (https://github.com/VadimDez/ng2-pdf-viewer)

  • πŸ‘ renders local pdfs
  • πŸ‘ customizable
  • πŸ‘Ž no pinch to zoom. add a button to do this manually
  • πŸ‘Ž sluggish

Cordova plugin document Viewer (can be used with file opener2)

https://github.com/sitewaerts/cordova-plugin-document-viewer

  • πŸ‘ view offline pdfs
  • πŸ‘Ž third party app download required to open (muPDF)

pspdfkit

Feature rich paid for library (https://pspdfkit.com/)

  • πŸ‘ clean ui
  • πŸ‘Ž expensive. ~ $500 yearly subscription.

Incompatible (deprecated libraries)

android navtive pdfviewer

https://github.com/Guutong/cordova-plugin-android-native-pdfviewer

Useful sources (attempts made by others)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment