dealfonso / pdfjs-viewer Goto Github PK
View Code? Open in Web Editor NEWA viewer based on PDFjs, which can be embedded in any web page (not using iframes)
License: Apache License 2.0
A viewer based on PDFjs, which can be embedded in any web page (not using iframes)
License: Apache License 2.0
Hello dealfonso,
I would like to know if you have an example of how to delete a page from the PDF, as well as how to set a footer for the thumbnails.
Nice work!
I am wondering if it is possible to open PDF's using the name in a URL. For example:
example.com/pdfjs-viewer/index.php?pdffile=somedoc.pdf
Need something like your pdfjs-viewer to use on school network to open local PDF's and restrict downloading them.
Thanks for sharing.
I figured out how to integrate your simple viewer into my website, but I am wondering how I would extend it to add a Find function. I believe the pdfjs has a built in find controller (I used it with the old 2.x pdfjs version with my simpleviewer implementation), but I am wondering how I would use that via your viewer as you did not add that to the js code.
Thanks for this package, can the version of pdf.js be updated ? current is 4.2.67
The original pdfjs makes it possible to render clickable links (with the help of the PDFLinkService - https://github.com/mozilla/pdfjs-dist/blob/master/web/pdf_viewer.js#L95). Is it possilble to achive that in pdfjs-viewer as well?
Hi, @dealfonso
Do you can get annotations data in the same page using your lib?
Because when I use iframe, I need call postMessage to communicate with root page.
Just wanted to bring up a possible issue in that using the pixel ratio value that you have in the viewer to determine the rendering canvas size can cause so much memory to be needed for full screen display on high res screens (I believe on my iPad the ratio is 2), that it crashes my site with longish documents on iOS devices. Hard coding the pixel ratio to 1 and then using the rendering scale that you recently added for more sharpness stopped all the crashes. It never crashes on my Windows computer with Chrome even with a rendering scale of 4, but my iPadd has been crash city until I overrode the pixel ration variable.
I am still mystified by the lack of character crispness of pdfjs version 3.x (which I am using), it seems that version 1 of pdfjs was VERY sharp with text-based documents but with the 'newer' versions is a bit fuzzy unless I up the rendering scale. Some sort of nonsense anti aliasing or something? Sheesh. If version 1 would render the latest versions of PDFs I would just use that, but some newer pdfs get a parse error and show just blank pages.
I'm using latest Firefox 126.01 (Ubuntu) and the pdfjs-viewer doesn't show pdf files at all.
I can reproduce it with all codepen examples.
For instance: https://codepen.io/dealfonso/pen/qBPPEEd is rendered as:
No errors are printed in the console, also there are no network errors. Happens also in the incognito mode with all adblockers etc being turned off. At the same time all is good in other browsers like Vivaldi.
Carlos: really appreciated pdfs-viewer.js. I have incorporated it into a large project.
Had a problem rendering many PDFs that had multiple pages. I changed one line of code and now it renders successfully:
_setPageContent($page, $content) {
//$page.find(`.${this.settings.contentClass}`).empty().append($content);
$page.find(`.${this.settings.contentClass}`).append($content);
}
I think that there was a race condition where empty() was completing after append() finished, so the image briefly appeared and then was removed. Even when append() runs more than once, it doesn't seem to duplicate the content of the page?
Thanks again for good work. [email protected]
!Que le vaya bien!
Hello,
I test your pdfjs-viewer, It's great for me. But on mobile device, I can't not use pinch gusture for 2 fingers to zoom in or out the pdf document(now can use only topbar button to zoom).
Please guide to use this feature.
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.