PDF export - size of PDF slightly different

Bug #495954 reported by Roeland Schoukens
This bug report is a duplicate of:  Bug #168275: wrong PDF export with rectangles. Edit Remove
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Undecided
Unassigned

Bug Description

When exporting to PDF, the page size is slightly changed. When using a background image this may result in a small white border in the PDF file.

Attached a SVG file and the resulting PDF file, the PDF file has a slightly larger page size. The green rectangle seems to keep its size.

My version is "Inkscape 0.47 r22583, built Nov 21 2009" on windows XP.

Revision history for this message
Roeland Schoukens (roelandschoukens) wrote :
Revision history for this message
Roeland Schoukens (roelandschoukens) wrote :
Revision history for this message
su_v (suv-lp) wrote :

this seems to be the same issue as reported in
Bug #169048 “White gaps around rectangles in PS/PDF”:
<https://bugs.launchpad.net/inkscape/+bug/169048>

other related reports:
Bug #168275 “wrong PDF export with rectangles”:
Bug #168957 “export to PDF leaves white gaps between rects”
Bug #385267 “y-position of bitmaps (linked or used as patterns) is changed in PDF export ”

Revision history for this message
su_v (suv-lp) wrote :

reproduced with Inkscape 0.47 on OS X 10.5.8

Changed in inkscape:
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

additionally the tip of the upper red triangle is cut off in the PDF file (not a miter/bounding box issue as there is no stroke, only fill color defined) - indicating that all objects are slightly moved up (1px? - or at least by the same amount as the additional white border at the bottom) in relation to the page borders.

Revision history for this message
Roeland Schoukens (roelandschoukens) wrote :

The upper triangle seems intact here. To create the attached PDF file none of the checkboxes were checked in the options dialog that came after the file picker. Using the option "the exported area is the page" gives the same result as the attached PDF file.

If I use the option "the exported area is the drawing" the PDF has, as expected, exactly the same size as the drawing, and both triangles are intact.

Revision history for this message
su_v (suv-lp) wrote :

1) cut-off top of red triangle indicating shift of drawing content not resize
screenshot with zoomed upper triangle of the above attached file 'test.pdf' viewed in gv 3.6.7 (GhostScript 8.70), same result with Apple's PDF viewer (Preview.app).

2) export options
Reproduced (comment #4) with default export options (new preferences file) where both page and area are _unchecked_ for PDF export (which corresponds to [x] Export area is page)

Revision history for this message
Roeland Schoukens (roelandschoukens) wrote :

Acrobat Reader on Windows XP shows the triangle intact. The page size indicated in the lower left corner (148.2 x 105.3mm) is a bit larger than the SVG (148 x 105mm). Opening the PDF file in inkscape also shows an intact upper triangle.

Revision history for this message
su_v (suv-lp) wrote :

You are correct: the page is resized to the next higher integer px value during export to PDF, the cut-off tip of the triangle might be an independent issue of the PDF viewers.

A) stored page sizes in the SVG and PDF file:
test.svg (px):
   width="524.40942"
   height="372.04724"
test.pdf (pts):
   /MediaBox [ 0 0 420 298.399994 ]

B) reported page size of 'test.pdf':
148.2 x 105.3 mm (AdobeReader/win32)
 14.82 x 10.53 cm (Preview.app/osx)
420 x 298.4 pts (GhostScript/osx)
420 x 298.40 pts (Inkscape/osx)
525 x 373 px (Inkscape/osx)
 14.82 x 10.53 cm (Inkscape/osx)

C) comparison in Inkscape 0.47:

- Document Properties:
SVG page size: 524.41 x 372.05 px
               148.00 x 105.00 mm
PDF page size: 525 x 373 px
               148.17 x 105.27 mm

- Tool Controls Bar (all values in 'px'):
rectangle (SVG)
 X=0.000
 Y=0.000
 W=524.409
 H=372.047

rectangle (PDF)
 X=0.000
 Y=0.954
 W=524.409
 H=372.046

upper triangle (SVG)
 X=217.610
 Y=327.047
 W=48.968
 H=45.000

upper triangle (PDF)
 X=217.612
 Y=328.000
 W=48.966
 H=45.000

lower triangle (SVG)
 X=240.769
 Y=-0.000
 W=48.968
 H=29.345

lower triangle (PDF)
 X=240.771
 Y=0.954
 W=48.965
 H=29.346

The comparison shows that width and height of the objects are approximately the same, whereas the Y-position has moved up slightly (0.954 px). This seems to be a result of the increased page size [1] and drawing the objects from the origin in the upper left corner downwards, leaving a gap at the bottom between the correctly converted rectangle and the rounded (px) size of the page height.

[1] as indicated in bug #169048 comment #10: "the pixel size is rounded up to an integer before it is converted to points" i.e the height of 372.05 px in the SVG document apparently turns into a height of 373 px for the PDF document.

I think it is the same issue as reported in bug #169048.

Revision history for this message
su_v (suv-lp) wrote :

no longer reproduced with Inkscape 0.47+devel r9307 on OS X 10.5.8

Linking as duplicate to bug #168275 “wrong PDF export with rectangles” (fixed in r9306). Please add a comment and revert the duplicate status if you don't agree and still see this PDF export error in current development snapshots (>= r9306).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.