Weird PDF export issue (page size)
Hi,
lately, I came upon this weird beavior when exporting to PDF:
I have to base documents of size A4, the only difference is that the 2nd document has a page definition.
If I open the 1st document (empty.svg, without the page definition), and export it as PDF, I get a PDF of size A4. Uncmpressing the PDF with pdftk shows a mediabox of size [0 0 595.275591 841.889764]
(divide 595.275591 by 72 and multiply by 25.4, we get 210mm, as expected)
If I now open the 2nd document (page.svg, with the page definition), and export it with exactly the same settings, I get a PDF which is slightly larger. In the Acrobat reader, it shows up as 210.3×297.0 mm, and looking at the uncompressed PDF the mediabox now has a size of [0 0 596 842], i.e. rounded up to the next integer.
(596 / 72 * 2.54 = 210.25555mm)
The PDF export options about rounding do not have any effect.
This is with Inkscape 1.3.2, I checked back with yesterday’s devel snapshot: now the empty.svg is also exported oversized (rounded up), the mediabox is now always rounded up to the next integer.
On Thu, 2024-09-26 at 17:05 +0200, Alexander Roalter wrote:
The PDF export options about rounding do not have any effect.
This is with Inkscape 1.3.2, I checked back with yesterday’s devel snapshot: now the empty.svg is also exported oversized (rounded up), the mediabox is now always rounded up to the next integer.
This is a known bug in cairo. They use integers for page width and height and so can only have an 72nds of inch values in PDF exports at the moment.
The options you found are related to resizing THE CONTENT of the pdf so it stretches to match this limitation.
The new PDF exporter from capypdf will not have this restriction. (as well as supporting cmyk, icc, and other things) expecting in the 1.5 version of Inkscape hopefully 2025.
Best Regards, Martin Owens
participants (2)
-
Alexander Roalter
-
Martin Owens