Code: Select all
inkscape -f legend.svg -A legend.pdf
but did not work, nor gave any error message.
Wrote the following python code to catch stdout and stderr:
Code: Select all
import subprocess
cmd = "c:\programs\editors\graphical\inkscape\inkscape.exe -f legend.svg -A legend.pdf"
proc = subprocess.Popen(cmd, shell=True,
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
)
stdout_value,stderr_value = proc.communicate()
print "Standard Output follows:"
print stdout_value
print "Standard Error follows:"
print stderr_value
Executed python script and received the following message:
Code: Select all
Standard Output follows:
** (inkscape.exe:1572): CRITICAL **:
Inkscape::XML::Document* sp_repr_read_file(const gchar*, const gchar*):
assertion `Inkscape::IO::file_test( filename, G_FILE_TEST_EXISTS )' failed
** (inkscape.exe:1572): CRITICAL **:
Inkscape::XML::Document* sp_repr_read_file(const gchar*, const gchar*):
assertion `Inkscape::IO::file_test( filename, G_FILE_TEST_EXISTS )' failed
** (inkscape.exe:1572): WARNING **: Specified document legend.svg cannot be
opened (does not exist or not a valid SVG file)
Standard Error follows:
None
But as far as I can tell legend.svg is a perfectly fine file that can be open with inkscape and actually saved as *pdf file, too. I just would like to automate this and do it programatically.
Any ideas? I would appreciate any pointers.
Thanks,
gsal