burghoff / Scientific-Inkscape

Scientific Inkscape: Inkscape extensions for figure resizing and editing
528 stars 20 forks source link

Autoexporter PDF export bugs #21

Closed kjohnsen closed 1 year ago

kjohnsen commented 1 year ago

It looks like the autoexporter is doing some funky things with diagram connectors and with super thin rounded rectangles. This doesn't happen with normal PDF export.

Original: image

PDF export: image

burghoff commented 1 year ago

Thanks for the report. Can you tell me what Advanced options are you using for the export? E.g., are you converting strokes to paths?

If you could include an SVG, that would also be helpful—just delete the parts that aren't causing problems.

As a temporary workaround, try marking anything that's causing problems for rasterization.

burghoff commented 1 year ago

I couldn't replicate it based on what's described. Test_rects.pdf Test_rects

Likely there's something specific about your SVG causing the issue. I will need it to do further investigation. You don't need to give me the whole thing if you don't want, just save a copy where you delete the parts of it that are not causing problems.

kjohnsen commented 1 year ago

Here you go. Looks like the rectangle issue is caused when rounded corner radii are bigger than what should be possible. And with the connectors...I can't figure it out. You'll see in the file some are exported as they appear in the SVG, and some are not. My main curiosity is, what are you doing that native Inkscape isn't to cause these things?

Actually, I just answered my own question. When I turn off 'Prevent thin line enhancement' both the rounded rectangle and the diagram connector problems go away.

image

test-autoexport2

test-autoexport2.pdf

burghoff commented 1 year ago

Thanks, I was able to replicate. I'll fix the issue.

Thin line enhancement is an unfortunate rendering feature of many PDF viewers. Acrobat is the worst, but to some extent many do it. It causes certain thin paths to be displayed as wider. Example below (note the ls): image

It's a rendering setting on the viewer's side, so there's not much you can do about it. The feature in the Autoexporter modifies the path to prevent this from happening.

burghoff commented 1 year ago

Ok, both issues have been fixed. I have never used or encountered connectors, but the Autoexporter now accounts for them. (The rectangle issue was just a bug.) New output: AE_Bugs.pdf

If you want the fix, it's currently on the dev branch: https://github.com/burghoff/Scientific-Inkscape/tree/dev