diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2016-09-08 09:12:52 +0100 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2016-09-08 11:20:41 +0100 |
commit | e221dcd1b756f2a6e04531876e43b587fa8577b1 (patch) | |
tree | bb21f206c475a1bcd8572d67903f74a7084b37c0 | |
parent | e644fc3454bf84555b2d8369138d2f25bfbf6133 (diff) | |
download | ghostpdl-e221dcd1b756f2a6e04531876e43b587fa8577b1.tar.gz |
pdfwrite - don't attempt to keep co-ordinates <32K when creating PDF 1.5+
Bug #697098 "pdfwrite charpath conversion problem"
When the PDFCompatibilityLevel is 1.5 or above we can use reals with
sensible ranges, instead of the +/- 32767 that old versions of the
specification limited us to.
This results in a large number of small differences, some minor progressions
-rw-r--r-- | devices/vector/gdevpdfd.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/devices/vector/gdevpdfd.c b/devices/vector/gdevpdfd.c index 94bb5d9b0..af25e6e3d 100644 --- a/devices/vector/gdevpdfd.c +++ b/devices/vector/gdevpdfd.c @@ -181,18 +181,20 @@ pdf_dorect(gx_device_vector * vdev, fixed x0, fixed y0, fixed x1, fixed y1, ymin -= d; ymax += d; } - /* - * Clamp coordinates to avoid tripping over Acrobat Reader's limit - * of 32K on user coordinate values. - */ - if (x0 < xmin) - x0 = xmin; - if (x1 > xmax) - x1 = xmax; - if (y0 < ymin) - y0 = ymin; - if (y1 > ymax) - y1 = ymax; + if (pdev->CompatibilityLevel < 1.5) { + /* + * Clamp coordinates to avoid tripping over Acrobat Reader's limit + * of 32K on user coordinate values. + */ + if (x0 < xmin) + x0 = xmin; + if (x1 > xmax) + x1 = xmax; + if (y0 < ymin) + y0 = ymin; + if (y1 > ymax) + y1 = ymax; + } return psdf_dorect(vdev, x0, y0, x1, y1, type); } @@ -787,6 +789,11 @@ make_rect_scaling(const gx_device_pdf *pdev, const gs_fixed_rect *bbox, { double bmin, bmax; + if (pdev->CompatibilityLevel > 1.4) { + *pscale = 1; + return false; + } + bmin = min(bbox->p.x / pdev->scale.x, bbox->p.y / pdev->scale.y) * prescale; bmax = max(bbox->q.x / pdev->scale.x, bbox->q.y / pdev->scale.y) * prescale; if (bmin <= int2fixed(-MAX_USER_COORD) || |