Skip to content

Commit

Permalink
Fix canvas height and width of PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
dasistwas committed Oct 26, 2023
1 parent c2fa068 commit f2d1929
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion amd/build/pdfembed.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amd/build/pdfembed.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions amd/src/pdfembed.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ function renderPDFfunction(url, canvasContainer, customScale) {
var desiredWidth = 595;
var desiredHeight = 841;

canvas.height = desiredHeight * customScale;
canvas.width = desiredWidth * customScale;
//canvas.height = desiredHeight * customScale;
//canvas.width = desiredWidth * customScale;
canvas.setWidth(desiredWidth * customScale);
canvas.setHeight(desiredHeight * customScale);

canvasContainer.appendChild(canvas);

Expand Down

0 comments on commit f2d1929

Please sign in to comment.