Skip to content

Commit

Permalink
print_pdf_runner.html: const -> var
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiago Perrotta committed Jun 14, 2023
1 parent e7c92ec commit 9267f29
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/wptrunner/wptrunner/print_pdf_runner.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
let rendered = [];
for (let pageNumber=1; pageNumber<=pdf.numPages; pageNumber++) {
let page = await pdf.getPage(pageNumber);
var viewport = page.getViewport({scale: 96./72.});
const viewport = page.getViewport({ scale: 96. / 72. });
// Prepare canvas using PDF page dimensions
var canvas = document.getElementsByTagName('canvas')[0];
var context = canvas.getContext('2d');
const canvas = document.getElementsByTagName('canvas')[0];
const context = canvas.getContext('2d');
canvas.height = viewport.height;
canvas.width = viewport.width;

// Render PDF page into canvas context
var renderContext = {
const renderContext = {
canvasContext: context,
viewport: viewport
viewport
};
await page.render(renderContext).promise;
rendered.push(canvas.toDataURL());
Expand Down

1 comment on commit 9267f29

@community-tc-integration
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh oh! Looks like an error! Details

HttpError: Invalid request.

Only 65535 characters are allowed; 2477746 were supplied.

Please sign in to comment.