Skip to content

Commit

Permalink
pdf: take device resolution into account when scaling PDF images
Browse files Browse the repository at this point in the history
Reported and tested by Dirk-Wilhelm Peters <peters@schwertfisch.de>.
  • Loading branch information
aligrudi committed Apr 16, 2018
1 parent 10f9357 commit 90d1d12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pdf.c
Expand Up @@ -660,9 +660,9 @@ static int pdfext(char *pdf, int len, int hwid, int vwid)
bbox = pdf_dval_val(pdf, len, pages, "/MediaBox");
if (bbox >= 0 && !pdfbbox(pdf, len, bbox, dim)) {
if (hwid > 0)
hzoom = hwid / (dim[2] - dim[0]);
hzoom = hwid / (dim[2] - dim[0]) * 7200 / dev_res;
if (vwid > 0)
vzoom = vwid / (dim[3] - dim[1]);
vzoom = vwid / (dim[3] - dim[1]) * 7200 / dev_res;
if (vwid <= 0)
vzoom = hzoom;
if (hwid <= 0)
Expand Down

0 comments on commit 90d1d12

Please sign in to comment.