Skip to content

Pdf visualization on mobile #1451

Open
Open
@pedroespindula

Description

@pedroespindula

Describe the bug
Its not possible to view a raw pdf in mobile like in desktop.

Possible solution
Create an iframe that has as a source the google pdf visualizer url with the pdf link as url param. This link to serve the pdf itself doesn't exist yet. Also, this link strategy doesn't work with the firebase download url.

  • Use example:
<iframe 
    src="https://docs.google.com/viewer?url=http://www.africau.edu/images/default/sample.pdf">
</iframe>

Useful links

  • About Google doc viewer:
  1. https://stackoverflow.com/questions/7437602/how-to-display-a-pdf-via-android-web-browser-without-downloading-first
  2. https://stackoverflow.com/questions/50855747/how-to-add-pdf-viewer-to-website-for-mobile-browsers
  • Explanation on why you can't visualize:
  1. https://www.quora.com/Why-does-Chrome-on-Android-not-open-PDF-files-like-Chrome-on-Windows-Linux-can

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions