SVG => PDF conversion problem with fills
Hello everyone. Sorry to bother you again with something strange, but my actual project needs all of this... :)
Attached you will see an SVG and its PDF created via inkscape. At the end i will need to create it from commandline (all of this is about a PHP app, so i cannot consider the GUI), anyhow to test how things looks like in inkscape i also installed it locally (with GUI)
As you can see, the SVG file is a bit unusual: it contains a nested SVG graphics, using a G container to place and scale it as needed. That nested object can be everything, as users will be allowed to send their own SVG files.
Now: in inkscape GUI, it looks correctly. I also included in zip a png files which will show you how the design should be. But in the PDF the "Fire Dept." nested SVG is wrong, totally wrong... It seems inkscape renders it correctly while in GUI, but fills the external paths with black when converting to PDF.
Same results of course when i try (as i will need to do) with commandline. Export command i'm using now is: inkscape -z svgfile.svg --export-pdf=pdffile.pdf --export-text-to-path
Any suggestion on how to solve this? Maybe some SVG formatting i should recommend to my users?
Many thanks in advance,
Alex
You're not indicating which version of Inkscape you are using, and if a recent build, which version of cairo. Those things matter for PDF export.
Oh, in your PDF I noticed:
/Producer(Inkscape 0.44.1)
That version is way too old. Upgrade, ideally to the recent dev version with newest cairo, and make sure you use the same version for GUI and command line.
On 10/23/07, Alexander Bonivento <redna379@...12...> wrote:
Hello everyone. Sorry to bother you again with something strange, but my actual project needs all of this... :)
Attached you will see an SVG and its PDF created via inkscape. At the end i will need to create it from commandline (all of this is about a PHP app, so i cannot consider the GUI), anyhow to test how things looks like in inkscape i also installed it locally (with GUI)
As you can see, the SVG file is a bit unusual: it contains a nested SVG graphics, using a G container to place and scale it as needed. That nested object can be everything, as users will be allowed to send their own SVG files.
Now: in inkscape GUI, it looks correctly. I also included in zip a png files which will show you how the design should be. But in the PDF the "Fire Dept." nested SVG is wrong, totally wrong... It seems inkscape renders it correctly while in GUI, but fills the external paths with black when converting to PDF.
Same results of course when i try (as i will need to do) with commandline. Export command i'm using now is: inkscape -z svgfile.svg --export-pdf=pdffile.pdf --export-text-to-path
Any suggestion on how to solve this? Maybe some SVG formatting i should recommend to my users?
Many thanks in advance,
Alex
This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
On Tue, 23 Oct 2007 21:41:35 -0300 "bulia byak" <buliabyak@...155...> wrote:
You're not indicating which version of Inkscape you are using, and if a recent build, which version of cairo. Those things matter for PDF export.
Oh, in your PDF I noticed:
/Producer(Inkscape 0.44.1)
That version is way too old. Upgrade, ideally to the recent dev version with newest cairo, and make sure you use the same version for GUI and command line.
I can reproduce this in current HEAD with cairo, a minimal test case is attached.
The problem seems to be that the inherited fill-rule value isn't used by the cairo pdf exporter. Is the correct way to fix this just to use the "computed" property instead of the "value" property? (See the attached patch)
-- Gustav
On 10/23/07, Gustav Broberg <broberg@...542...> wrote:
The problem seems to be that the inherited fill-rule value isn't used by the cairo pdf exporter. Is the correct way to fix this just to use the "computed" property instead of the "value" property? (See the attached patch)
Yes, the computed value is always the effective value, so it should be used on export. Please commit your patch, and thanks for figuring this out so quickly!
Great, i will try the patch as soon as possible then! Thank you both very much, i really have no other words to express my gratitude.
Alex
bulia byak wrote:
On 10/23/07, Gustav Broberg <broberg@...542...> wrote:
The problem seems to be that the inherited fill-rule value isn't used by the cairo pdf exporter. Is the correct way to fix this just to use the "computed" property instead of the "value" property? (See the attached patch)
Yes, the computed value is always the effective value, so it should be used on export. Please commit your patch, and thanks for figuring this out so quickly!
as an alternative you may also try conversion to PDF with the batik-rasterizer (http://xmlgraphics.apache.org/batik/tools/rasterizer.html) - which also runs on servers without gui. Its a java solution but it works well. In my experience Batik runs very well with various hand-generated SVG, including nested svgs, etc.
This doesn't mean that the problem shouldn't be fixed in Inkscape, though ...
Andreas
Great, i will try the patch as soon as possible then! Thank you both very much, i really have no other words to express my gratitude.
Alex
On Wed, 24 Oct 2007 09:25:46 +0200 (CEST) "Andreas Neumann" <a.neumann@...2251...> wrote:
as an alternative you may also try conversion to PDF with the batik-rasterizer (http://xmlgraphics.apache.org/batik/tools/rasterizer.html) - which also runs on servers without gui. Its a java solution but it works well. In my experience Batik runs very well with various hand-generated SVG, including nested svgs, etc.
This doesn't mean that the problem shouldn't be fixed in Inkscape, though ...
It _is_ fixed now, btw...
-- Gustav
YEP, confirmed!!! I finally compiled the new SVN (which included the discussed patch) and now all works as expected.
Thank you very much Gustav, i owe you one
Alex
Gustav Broberg wrote:
On Wed, 24 Oct 2007 09:25:46 +0200 (CEST) "Andreas Neumann" <a.neumann@...2251...> wrote:
as an alternative you may also try conversion to PDF with the batik-rasterizer (http://xmlgraphics.apache.org/batik/tools/rasterizer.html) - which also runs on servers without gui. Its a java solution but it works well. In my experience Batik runs very well with various hand-generated SVG, including nested svgs, etc.
This doesn't mean that the problem shouldn't be fixed in Inkscape, though ...
It _is_ fixed now, btw...
-- Gustav
This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Thank you for your reply. In the server (the one that will use commandline) i have: Inkscape 0.45.1 Cairo 1.2.6
This is also what yum returns as last compiled versions. With this versions, the generated PDF has the same issues
It seems that inkscape version is already the latest stable (not dev) release, but cairo is not.
If you can, i would have a great favour to ask: That server is already in production, so i would avoid altering libs in order to compile newest versions till i'm sure it will be needed. If you do have the latest inkscape dev and cairo, would you please try to perform the inkscape -z svgfile.svg --export-pdf=pdffile.pdf --export-text-to-path command over the SVG file i attached in first post, and show me that PDF? Knowing if this upgrade will solve the issue would be a great help to me.
Thanks in advance, sorry to abuse of your patience!
Alex
bulia byak wrote:
You're not indicating which version of Inkscape you are using, and if a recent build, which version of cairo. Those things matter for PDF export.
Oh, in your PDF I noticed:
/Producer(Inkscape 0.44.1)
That version is way too old. Upgrade, ideally to the recent dev version with newest cairo, and make sure you use the same version for GUI and command line.
On 10/23/07, Alexander Bonivento <redna379@...12...> wrote:
Hello everyone. Sorry to bother you again with something strange, but my actual project needs all of this... :)
Attached you will see an SVG and its PDF created via inkscape. At the end i will need to create it from commandline (all of this is about a PHP app, so i cannot consider the GUI), anyhow to test how things looks like in inkscape i also installed it locally (with GUI)
As you can see, the SVG file is a bit unusual: it contains a nested SVG graphics, using a G container to place and scale it as needed. That nested object can be everything, as users will be allowed to send their own SVG files.
Now: in inkscape GUI, it looks correctly. I also included in zip a png files which will show you how the design should be. But in the PDF the "Fire Dept." nested SVG is wrong, totally wrong... It seems inkscape renders it correctly while in GUI, but fills the external paths with black when converting to PDF.
Same results of course when i try (as i will need to do) with commandline. Export command i'm using now is: inkscape -z svgfile.svg --export-pdf=pdffile.pdf --export-text-to-path
Any suggestion on how to solve this? Maybe some SVG formatting i should recommend to my users?
Many thanks in advance,
Alex
This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
participants (4)
-
Alexander Bonivento
-
Andreas Neumann
-
bulia byak
-
Gustav Broberg