alekswebnet / pdfjs-viewer-element Goto Github PK
View Code? Open in Web Editor NEWThe simplest integration of PDF.js default viewer using the iframe element and web component
Home Page: https://alekswebnet.github.io/pdfjs-viewer-element/
The simplest integration of PDF.js default viewer using the iframe element and web component
Home Page: https://alekswebnet.github.io/pdfjs-viewer-element/
STR:
src
or viewer-path
Thanks for the very useful module! I'm running into an issue where my site needs to make requests having "with credentials" set to true. It looks like pdfjs supports this, but I don't see a means to set that at the custom element level with this package.
Happy to submit a PR to this repo for the feature, but I might need to ask a couple of questions to make sure I'm doing it right, and this type of thing might be easier to do rather than help do.
Let me know if this feature sounds good, and if starting to work on a PR sounds good.
See post comments here: https://stackoverflow.com/questions/77881917/is-it-possible-to-create-a-web-component-of-pdfjs
For now, the browser continually defines the language of the viewer. Needed the possibility of setting any language, that no depends on the browser.
Since pdfjs-dist doesn't ship with viwer.html is it possible to release another package that ships all the files?
Similar to https://www.npmjs.com/package/pdfjs-dist-ei-11-with-viewer and https://www.npmjs.com/package/@awlsn/pdfjs-full.
This would allow using npm instead of downloading and checking which makes it easy for getting started with node modules.
I load the pdf with src and would like to avoid others clicking Open File to open a menu.
ref: mozilla/pdf.js#12625
const ViewerCssTheme = {
AUTOMATIC: 0, // Default value.
LIGHT: 1,
DARK: 2,
};
Even better if we can pass options to the component or give us callback which allows to set the options.
README.md uses a function with callback.
viewerApp.eventBus.on('pagesloaded', () => {
console.log('Viewer pages loaded')
})
while typings shows eventBus: Record<string, any>;
.
if there is on how do I remove event listeners?
Is it possible to invoke PDFViewerApplication.open()
method to open files loaded outside of the librar?
see here:
https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support
use Uint8Array instead of URL in the PDFViewerApplication.open
Would love to see a bit more documentation on how to use inside framworks like Vue.
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.