Export many pdfs from command line (30% faster)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
New
|
Wishlist
|
Unassigned |
Bug Description
Hi.
I need to export a number of svg documents to pdfs using inkscape from the command line. Actual command execution is done by a shell script. I would like to propose a new feature=
The problem is that in order to export 3 documents I had to invoke three commands:
>inkscape -f 1.svg -A 1.pdf
>inkscape -f 2.svg -A 2.pdf
>inkscape -f 3.svg -A 3.pdf
I have changed main.cpp file so that currently this could be done as:
>inkscape -f 1.svg 2.svg 3.svg -A unused.pdf
The result documents are 1.svg.pdf, 2.svg.pdf, 3.svg.pdf and the unused.pdf is actually "unused".
Testing the two approaches showed good performance improvements. On exporting 40000 documents with "inkscape -f 1.svg 2.svg -A unused.pdf" rather then "inkscape -f 1.svg -A 1.pdf && inkspace -f 2.svg -A 2.pdf" I got an average of 30% faster execution.
Change is done in:
void sp_process_
...
if (sp_export_pdf) {
gchar pdfext[6] = {".pdf\0"};
gchar *new_export_pdf = g_strconcat(
g_free(
}
...
}
Would it be possible to take a look on my approach and probably include this, or a similiar feature in inkscape? I could prepare a patch if you like the idea.
tags: | added: cli exporting pdf |
Changed in inkscape: | |
importance: | Undecided → Wishlist |
1) Please attach a proper patch ('diff -u' or 'bzr diff' preferred) and provide information against which version (Inkscape 0.48.2, Inkscape trunk) the patch is meant for.
2) The syntax you propose seems highly ambiguous to me: users would expect that Inkscape can export multiple SVG documents merged into a single PDF fiel (which it can't).
3) Why don't you use the existing shell mode to export multiple files without launching a new process for every export?
example to export 10 files in one process using bash:
for i in {1..10}; do echo " -f file-$i.svg -A file-$i.pdf"; done | inkscape --shell
(Note: when using this to process a huge number of files, there is a small memory leak occuring that needs to be fixed, see bug #722229.)