mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.25k stars 9.96k forks source link

[suggestion] Script to replace the pdf plugin #8601

Closed yurivict closed 7 years ago

yurivict commented 7 years ago

Some websites expect a browser to have the pdf plugin:

<object data="myfile.pdf" type="application/pdf" width="100%" height="100%">
  <p>Alternative text - include a link <a href="myfile.pdf">to the PDF!</a></p>
</object>

But some browsers don't have the pdf plugin, webkit for example. It should be possible to rewrite such code and replace it to use pdfjs. Is such script available? Or can the pdfjs project provide such script?

Snuffleupagus commented 7 years ago

I've not tried, but it seems that https://pdfobject.com/ may be able to do what you ask. Closing, since this is out of scope for the PDF.js project.

yurivict commented 7 years ago

PDFObject embeds pdf into the page using the 'embed' clause, or iframe with prepared html. It doesn't replace embeds/iframes to use pdfjs.