Create PDF from Inkscape SVG without destroying fonts and effects
Solution 1
You should upgrade your Inkscape to the PPA version Pre-0.49, my testing produced results using masking, clipping and a reference path difference:
To upgrade your inkscape, open up a terminal and issue the following commands:
sudo add-apt-repository ppa:inkscape.dev/trunk
sudo apt-get update
sudo apt-get install inkscape-trunk
This should remove the 0.48 version of inkscape and replace it with the pre-0.49 version you need for your pdf file.
Solution 2
You might also try converting your inkscape .svg
file to .pdf
using rsvg-convert
from the librsvg2-bin
package:
rsvg-convert -f pdf -o foo.pdf foo.svg
This preserved transparency in my file.
Solution 3
Okay, here's my two cents on a workaround for this.
I tried the previous answer using rsvg-convert
, which worked fine for transparent items. Problem is now, I have an embedded image in my SVG that actually got rasterized with a very low resolution.
Specifying a higher X/Y dpi for rsvg-convert
didn't change that.
So I did the following, which resolved the issue:
- "Rasterizing" the image into a PDF:
rsvg-convert -f pdf -o rasterized.pdf orig.svg
- Open the original image in Inkscape:
inkscape orig.svg
- Open the rasterized image (now containing transparent shapes, but also the rasterized embedded image) in Inkscape:
inkscape rasterized.pdf
- Ungroup all items in the latter until you get to the wrongly rasterized image
- Copy the embedded image from 2. into the one from 4., replacing the wrongly rasterized one
- Save it as PDF through Inkscape normally.
Result: Transparent shapes, and high-resolution images.
Solution 4
One solution I have found to solve this obvious bug, is: In Inkscape save as: EPS then epstopdf the file. Result is looking perfect
Related videos on Youtube
![Pham Minh Tan](https://lh5.googleusercontent.com/-60iIVEjx5uM/AAAAAAAAAAI/AAAAAAAAAmk/i8kG4IB1his/photo.jpg?sz=256)
Pham Minh Tan
Updated on September 18, 2022Comments
-
Pham Minh Tan almost 2 years
i have a select box to style with css like this.
My style
select { background-color: #b9def8; border: none; border-radius: 2px; width: 260px; height: 60px; padding-left: 10px; font-size: 16px; color: #676863; background: url('../img/arrow-dropdown.png') no-repeat right #ddd; -webkit-appearance: none; }
But with style above, normal select box become a select box like this.
What can i do now? Thanks.
-
Glutanimate about 11 yearsWhat Inkscape build are you using? Transparencies and PDF export work fine for me (latest inkscape dev trunk from this PPA). Are you sure that transparencies are the real issue? Looks to me as though there are more things wrong with the PDF output. If worse comes to worst you can always export the file as a high-resolution raster and convert it to PDF with
convert image filename.pdf
. -
Tomas Aschan about 11 years
inkscape --version
gives meInkscape 0.48.4
, after first printing the warning message(inkscape:19694): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
a bunch of times. It was installed from the default repositories in Ubuntu 13.04. As for the pdf, I suppose there might be other problems as well (the font seems off, for example), but I would guess they are ultimately related. -
Glutanimate about 11 years
-
Glutanimate about 11 yearsJust to be clear, did you apply those effects to "Sydamerika" manually or are they part of a font?
-
Jeremy Carlson about 9 yearsAre you sure your PNG is just the gray part, and not the blue part?
-
Pham Minh Tan about 9 yearsMy PNG images is a arrow with blue part around.
-