Ezra Siton
Ezra Siton

Reputation: 7741

Pdf.js : How to load file + view -- An error occurred while loading the PDF. More InformationClose (Searching for "normal" example)

I copy-paste the source from this example: https://mozilla.github.io/pdf.js/web/viewer.html

My Code example (No docs so I follow the source code): https://codepen.io/ezra_siton/pen/bGdMPqe enter image description here

I don't find any call to PDF url under the official example (Filename is: compressed.tracemonkey-pldi-09.pdf) + The docs missing + Zero examples out there (Codepen/Jfiddle).

I am searching for the most basic hello-world example (Very weird "unusable" docs for pdf.js ==> "can't see the forest for the trees").

The official examples here not helpful (Where is the UI bar?): https://mozilla.github.io/pdf.js/examples/

Upvotes: 2

Views: 3157

Answers (1)

Satheesh
Satheesh

Reputation: 656

@Ezra

If your purpose of using it as a viewer plugin in your website/app. Please add the plugin to your website or web application and redirect the call to this snippet.

<a href="/web/viewer.html?file=%2Fyourpdf.pdf">Open yourpdf.pdf with PDF.js</a>

Additionally, you can refer for more information - https://github.com/mozilla/pdf.js/wiki/Setup-pdf.js-in-a-website

Upvotes: 0

Related Questions