webodf / ViewerJS

ViewerJS: Document Reader in JavaScript
http://viewerjs.org
1.94k stars 421 forks source link

Capture the current page's width in page change evt ? #299

Open gn00979905 opened 3 years ago

gn00979905 commented 3 years ago

Hi everyone, I would like to know how to capture the current page's width in page change event? For some page will be very big size of paper, I need to detect it. Thank you very much!

gn00979905 commented 3 years ago

I figured out. In 'page change' event: var pageview=PDFViewerApplication.pdfviewer.getPageView(evt.pageNumber-1).pdfPage.getViewport(1); var pagewidth = pageview.width;