Batch convert to pdf (problem with InkscapeBatch tool)

Post questions on how to use or achieve an effect in Inkscape.
drmrbrewer
Posts: 4
Joined: Tue Apr 05, 2016 6:35 am

Batch convert to pdf (problem with InkscapeBatch tool)

Postby drmrbrewer » Tue Apr 05, 2016 6:41 am

Until now I've been using the InkscapeBatch tool (https://sourceforge.net/projects/inkscapebatch/) to batch convert a number of svg files to a corresponding number of pdf files. It works well.

But the problem I've now encountered is this...

I was having problems with fill patterns in Inkscape just ending up pure black when printed. From some googling it seemed that the problem could be solved by using the 32 bit version of Inkscape instead of the 64 bit version.

Sure enough, with the 32 bit version the fill patterns print correctly!

BUT now I've found that the trusty InkscapeBatch tool seems to need the 64 bit version installed.... aaargh! It complains about Inkscape not being found, then something about the wrong Inkscape version is installed.

So now I'm stuck... to get properly-printed fills I need 32 bit, but for batch conversion I need 64 bit... can anyone help me out of this mess?

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Batch convert to pdf (problem with InkscapeBatch tool)

Postby Moini » Tue Apr 05, 2016 7:44 am

So, you're probably on Windows. Do you happen know how to write small scripts for the Windows shell? (I don't, could only do this for Linux)

Then you can just write a simple script yourself, using the command line functionality of Inkscape.
You would have to repeat this:

inkscape filename.svg --export-pdf=FILENAME.pdf

(this will export the page area, more info here: https://inkscape.org/en/doc/inkscape-man.html)
for each file in a specific directory (or, if you're feeling more comfortable with writing a script, you could also use the interactive mode).

If, OTOH, the above command doesn't work at all on the command line, then something might be wrong with Inkscape not being available in your path...
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

drmrbrewer
Posts: 4
Joined: Tue Apr 05, 2016 6:35 am

Re: Batch convert to pdf (problem with InkscapeBatch tool)

Postby drmrbrewer » Tue Apr 05, 2016 5:21 pm

It's funny how encountering a problem with a method that you've been using for ages, without thought, sometimes leads you to a better method than before! Yes, you're right, a simple script does the job, and now the whole process of batch converting is so much simpler than before. Particularly when the number and names of the svg files in the batch changes over time... with the script there is no need to update or create a new batch conversion file... just run the script and away we go!

In case it helps others, a simple script on Windows (that you can modify as you wish, e.g. to put the output into a subfolder, or change the output file names, or change the exe path) is:

Code: Select all

FOR %%A IN (*.svg) DO "C:\Program Files (x86)\Inkscape\inkscape.exe" %%A --export-pdf=%%A.pdf


Just put the above in a text file named e.g. "convert.bat" (a "batch" file) in the same folder as the svg files, and in a Windows explorer window just double click on the convert.bat file... the converted pdf files will be dumped into the same folder.

Thanks for steering me in the right direction!

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Batch convert to pdf (problem with InkscapeBatch tool)

Postby Moini » Tue Apr 05, 2016 7:20 pm

Thank you, too, for making your script available to other users :) Glad I could be of help!
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “Help with using Inkscape”