Inkscape Community

Help Using Inkscape => Beyond the Basics => Topic started by: gauche on April 18, 2018, 12:47:46 AM

Title: Why doesn't this SVG export as PDF?
Post by: gauche on April 18, 2018, 12:47:46 AM
Hi,

I was working on some branding (disclaimer: I am not a designer) and was exporting bits and pieces to PDF just fine. Then I added another design element and nothing would export correctly anymore - I just get a blank PDF. I tried copying bits and pieces out of the SVG into a separate one, and it still didn't export correctly. I tried uploading it to various online conversion websites - same result (guessing they're using Inkscape as a backend though).

Can anyone tell me why the attached SVG exports as a blank PDF?

 [ You are not allowed to view attachments ]

Thanks
Title: Re: Why doesn't this SVG export as PDF?
Post by: Moini on April 19, 2018, 05:23:29 AM
There's a problem with how the gradients (all objects are filled with a gradient) are defined.
Those gradients with a 'stop' tag inside can be displayed in Inkscape, but they cannot be edited, nor do they export to pdf.

To get rid of them, select each object and use the dropper tool with the object itself (you can also select multiple objects with the same color).
If you want to, you can then also remove the incompatible gradient definitions in the defs section of the SVG file, because they do not get removed automatically when running 'clean up document'.

Please also help Inkscape developers fix the issue by posting a bug report at https://bugs.launchpad.net/inkscape .
Title: Re: Why doesn't this SVG export as PDF?
Post by: brynn on April 19, 2018, 10:05:10 AM
Moini, is that "stop id" related to the swatch?  I seem to recall that swatches are id'd as gradients (even though they aren't gradients), but I don't know how the stop id fits.

Yeah, that's what it looks like.  I just created a swatch in a new document, and it has the same stop id.

But wait, regular gradients have the same thing.  Does that mean that images with gradients can't be saved to PDF?  That would be a pretty serious bug, wouldn't it?

Well, I successfully saved an SVG file as PDF, with both a swatch-filled and gradient-filled object.  Let me test gauche's....  Hhmm, no luck there.

There must be more to it, than just the stop tag in the XML.  Can you explain more, Moini?
Title: Re: Why doesn't this SVG export as PDF?
Post by: Moini on April 20, 2018, 04:48:20 AM
It seems to be the transform matrix on the one-stop gradient (which is a swatch, indeed). If you remove that from each swatch in the document, it works.

Has this document been created with Inkscape from scratch?
Title: Re: Why doesn't this SVG export as PDF?
Post by: brynn on April 21, 2018, 10:16:18 PM
When I create a swatch from within Inkscape, it does not create the attribute "gradientTransform" (value "matrix"), as exists in the file attached.  Perhaps it's either the gradientTransform attribute, or the matrix value, (or both?) that's the source of the problem?
Title: Re: Why doesn't this SVG export as PDF?
Post by: gauche on April 24, 2018, 07:14:07 PM
Sorry for the delayed response, and thank you for providing the answer.

I can confirm that the file was entirely created within Inkscape. There are six distinct branding designs within my original SVG, and it was only this last one I provided that caused PDF conversions to stop working. I guess I did something that triggered the addition of the matrix transforms.

Anyway, by opening the SVG in notepad and manually removing all matrix transforms on all linear gradients, it works perfectly!

 :ty1: :ur:
Title: Re: Why doesn't this SVG export as PDF?
Post by: Moini on April 25, 2018, 06:45:29 AM
Would you make a bug report for this, please, gauche? If Inkscape users can create files that don't export to pdf at all, that's not good... :-(

Please visit https://bugs.launchpad.net/inkscape to add one. And if you can remember how the objects in the file got their gradients (e.g. did you copy them in from another file? Did you use an auto-palette? Anything can help!) that would be very valuable info to add.
Title: Re: Why doesn't this SVG export as PDF?
Post by: brynn on April 29, 2018, 12:24:55 AM
Also, if you can post a link here, to the new bug report, it will help us to be able to follow it.

If you don't want to get involved in this way, if you could provide whatever info you can remember about those particular objects, we can make the bug report.

I did note your comment that you made that file entirely in Inkscape.  And that makes it even more important for developers to know what's causing this problem.  So if you can remember anything about how you made those particular objects, it would be helpful.
Title: Re: Why doesn't this SVG export as PDF?
Post by: gauche on May 02, 2018, 12:16:03 AM
Here is the report: https://bugs.launchpad.net/inkscape/+bug/1768444
Title: Re: Why doesn't this SVG export as PDF?
Post by: Moini on May 02, 2018, 06:15:35 AM
Perfect, thank you!