Skip to content

Commit

Permalink
PDF: Fix resolution when zooming in (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
AgnesToulet authored Feb 26, 2024
1 parent 95fdaab commit 6080333
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/browser/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,13 @@ export class Browser {

if (isPDF) {
const scale = parseFloat((options.deviceScaleFactor as string) || '1') || 1;
if (scale < 1) {
await this.setViewport(page, {
...options,
deviceScaleFactor: 1 / scale,
});
}

return page.pdf({
...getPDFOptionsFromURL(options.url),
margin: {
Expand Down

0 comments on commit 6080333

Please sign in to comment.