PDF export: improve precision of pdf image sizesco-6.4-55cp-6.4-55
commitad0d65badf2d496e342d6f6da7b169bb507c203b
authorMiklos Vajna <vmiklos@collabora.com>
Fri, 4 Feb 2022 09:55:28 +0000 (4 10:55 +0100)
committerMiklos Vajna <vmiklos@collabora.com>
Mon, 7 Feb 2022 15:04:34 +0000 (7 16:04 +0100)
tree265f9be1472cc7f1733d6a0457965ec316629bf7
parent71ad86dcf8f94349250895a4b3a9e826b46b930f
PDF export: improve precision of pdf image sizes

This helps exporting full-page PDF images from Draw more accurately. In
case the page size was A4, then the page height is 841.8897637795276
i.e. 842 points. Full-page PDF images are scaled to this size, so the
referred PDF form XObject has the reciprocal of that scaling.  We used
to just write 0.00118, doubling the precision leads to
0.0011878840.

In practice the old precision resulted in e.g. hyperlink rectangles to
get out of sync with link text after 2 roundtrips, while the new
precision doesn't result in any noticeable modification to the link text
position after a roundtrip.

(cherry picked from commit 50682cea4196819980c8e2d4018f80384097ce6f)

Conflicts:
vcl/qa/cppunit/pdfexport/pdfexport.cxx

Change-Id: I72cc68696b9b9bcc1cbfde8df331c2b9c5f9eb29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129498
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129592
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
vcl/qa/cppunit/pdfexport/pdfexport.cxx
vcl/source/gdi/pdfwriter_impl.cxx