
We all know that you currently cannot "save" a pdf or ps file with transparency/gradients, but we know that you can 'print' transparency/gradients by selecting the print as bitmap. The resulting PS/PDF is obviously not vector oriented anymore, but from a pragmatic point of view that doesn't matter. I use this 'trick' from the command line inkscape options to quickly transform multiple svg files into pdf files.
Just take the following lines and put them in a file. Make them executable (chmod 755, at least for linux/unix platforms). And then call it svg2pdf . It works fine and I find it very useful.
If you use one argument, it will create a file tmp.ps, which you can easily transform in a pdf file using ps2pdf. If you use 2 arguments, the first one is DPI and the second the svg file. Maybe somebody finds this useful, that is why I post it here:
#!/bin/bash
DPI=90
if [ $# == 0 ] then echo "Need svg file!" exit fi
if [ $# == 1 ] then FILE=$1 fi
if [ $# == 2 ] then DPI=$1 FILE=$2 fi
inkscape -d $DPI -e tmp.png $FILE > /dev/null 2>&1
WIDTH=`grep "width=" $FILE |head -n1` HEIGHT=`grep "height=" $FILE |head -n1`
echo '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' > tmp.svg echo '<!-- Created with Inkscape (http://www.inkscape.org/) -->' >> tmp.svg echo '<svg' >> tmp.svg echo ' xmlns:svg="http://www.w3.org/2000/svg"' >> tmp.svg echo ' xmlns="http://www.w3.org/2000/svg"' >> tmp.svg echo ' xmlns:xlink="http://www.w3.org/1999/xlink"' >> tmp.svg echo ' version="1.0"' >> tmp.svg echo $WIDTH >> tmp.svg echo $HEIGHT >> tmp.svg echo ' id="svg1343">' >> tmp.svg echo ' <defs' >> tmp.svg echo ' id="defs1345" />' >> tmp.svg echo ' <g' >> tmp.svg echo ' id="layer1">' >> tmp.svg echo ' <image' >> tmp.svg echo ' xlink:href="tmp.png"' >> tmp.svg echo ' x="0"' >> tmp.svg echo ' y="0"' >> tmp.svg echo $WIDTH >> tmp.svg echo $HEIGHT >> tmp.svg echo ' id="image1371" />' >> tmp.svg echo ' </g>' >> tmp.svg echo '</svg>' >> tmp.svg
inkscape --print='>tmp.ps' tmp.svg
rm -f tmp.svg

On 4/25/06, Gijsbert Stoet <stoet@...679...> wrote:
We all know that you currently cannot "save" a pdf or ps file with transparency/gradients,
Actually, gradients without transparency _are_ supported by native PS export.
Anyway, thanks for the script!
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org
participants (2)
-
bulia byak
-
Gijsbert Stoet