export object to pdf - rasterized effects cropped to page size

Bug #1605402 reported by Michal Srb
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

Steps to reproduce:
1. Create object that crosses page edge and give it some effect (e.g. dropped shadow).
2. Save as PDF, choose "Rasterize filter effects" and set Bleed to 5 mm.

Result:
The object and the effect are rasterized and visible in the PDF, but they are cropped by the page size. The bleed area is empty.

Expected result:
The object and the effect should be visible in the page and bleed area.

Additional notes:
* Objects that don't get rasterized are visible in the bleed area.
* The same problem happens if you select "Use exported object's size" and try to export object crossing page boundary.

Analysis:
The function sp_asbitmap_render in src/extension/internal/cairo-render.cpp always limits the bounding box to the document size. This is incorrect if we are saving different area:

    Geom::Rect docrect(Geom::Rect(Geom::Point(0, 0), item->document->getDimensions()));
    bbox &= docrect;

Removing those two lines fixes the problem, but is probably not the best fix. Correct fix would be to use the actual bounding box that is calculated inside CairoRenderer::setupDocument, but doesn't seem to be saved anywhere. I am not familiar with inkscape code enough to suggest a good fix.

Revision history for this message
Michal Srb (michalsrb) wrote :
Revision history for this message
Michal Srb (michalsrb) wrote :
Revision history for this message
Michal Srb (michalsrb) wrote :
Revision history for this message
Michal Srb (michalsrb) wrote :
su_v (suv-lp)
tags: added: exporting filters-svg pdf
Revision history for this message
Phil Miesle (mieslep) wrote :

This looks to apply to ANY object with ANY filter applied to it. I've tried a dozen different filters (drop shadow, blend, etc) and they all end up with the same result.

Revision history for this message
Phil Miesle (mieslep) wrote :

Note that PNG export does not seem affected, I'm only seeing this problem in PDF exporting.

Revision history for this message
John Hoffman (splittingpixels) wrote :

Confirmed... this is a terrible bug that makes the bleed/margin export option useless for .pdf export in many cases. A (cumbersome) workaround is to select your crop marks and resize-to-selected in the page options just before export so that the filtered objects don't get clipped.

Revision history for this message
Patrick Storz (ede123) wrote :
Changed in inkscape:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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