Closed handhikadj closed 3 years ago
set the width (and height) in
style
property of<div id="pageContainer" class="pdfViewer singlePageView"></div>
Sorry, but it's not expected to work like that since the scale
(in the pageviewer.js
file) is what controls the final size of the canvas
.
To work-around that, you'll need to modify the scale
accordingly to enforce a particular width or height; please see the "Alternatively, if you want the canvas to render to a certain pixel size you could do the following:"-part of the example at https://mozilla.github.io/pdf.js/examples/index.html#rendering-the-page
Closing as answered (or possibly a duplicate of e.g. issue #5628).
Attach (recommended) or Link to PDF file here: it's on the example
Configuration:
Steps to reproduce the problem:
style
property of<div id="pageContainer" class="pdfViewer singlePageView"></div>
What is the expected behavior? (add screenshot) Can set fixed width and height
What went wrong? (add screenshot) Cannot set it
Notice the canvas and textLayer width and height don't get set