gtm-nayan / svelte-pdfjs

https://gtm-nayan.github.io/svelte-pdfjs
MIT License
31 stars 8 forks source link

Expose PDFDocumentProxy, or some other way of accessing document info #6

Closed OJFord closed 2 years ago

OJFord commented 2 years ago

For example, as far as I can see it isn't possible to limit the supplied pageNumber to the actual total number of pages, or to display page {pageNumber} of {pageTotal} - since there's no way of getting the total?

PDFDocumentProxy has a numPages method that could provide this, along with other potentially useful metadata.

gtm-nayan commented 2 years ago

v0.1.1: Document now emits loadsuccess with a detail of type PDFDocumentProxy and loaderror with a detail of type Error.

The events currently don't have typing for inline event handlers so I'll keep this open until I can figure that out.