2

Is it possible to make inkscape save two formats not just one at a time?

Preferably without appearing where to save the file every time, because I would predefine it, and without appearing portable document format, when I save it as pdf.

The filename would be called based on the biggest number in the predefined folder +1.

All of this with a shortcut.. Is it tangible?

So I would click a shorcut (like ctrl + f) and it would save the file automatically in the predefined folder in an svg and a pdf format without any pop-up, popping out, as 2.svg and 2.pdf.

It would be called 2 because there would be already 0.svg and 0.pdf and 1.svg and 1.pdf.

2

According to the manpage of inkscape, it can produce PDF files from the command line:

   -A FILENAME, --export-pdf=FILENAME
           Export document(s) to PDF format. This format preserves the transparency in the original SVG. Used fonts are subset and
           embedded.  The default export area is page; you can set it to drawing by --export-area-drawing. You can specify --export-id
           to export a single object (all other are hidden); in that case export area is that object's bounding box, but can be set to
           page by --export-area-page.

   --export-pdf-version=PDF-VERSION
           Select the PDF version of the exported PDF file. This option basically exposes the PDF version selector found in the PDF-
           export dialog of the GUI. You must provide one of the versions from that combo-box, e.g. "1.4". The default pdf export
           version is "1.4".

In combination with a scheduler on your system, you might look every minute for a fresh svg-file, not older than 2 minutes to account for rounding effects, and create the PDF file automatically. Of course it would be reasonable to only look in very limited area for such new svg files.

Another option is inotify, which watches file system events (Linux). I don't know your operating system, but maybe it has something equivalent. This could be used to trigger such a conversion script, too.

If you only need this functionality in some cases, it might be controlled by choosing the directory for the SVG file and restrict the scheduler/inotify to that one.

If that is not an option, it might be controlled by a special startup script, which performs such behaviour and starts inkscape in parallel and performs the pdf-export, sleeping for a certain amount of time between looking for a freshly saved svg.

In all cases it will be useful to know the OS you're using and the question might be concretized on superuser (or AskUbuntu, Unix&Linux, I guess there is a MacOS-section too, somewhere ...).

  • I am using Ubuntu 17.10 – user9613078 Apr 15 '18 at 9:40
  • And do you know cronjobs (cron, crontab)? About inotify, I know that it exists but haven't used it so far. Do you need the functionality often and always when working with inkscape or only occasionally? Is using a certain base folder for the svg-files an option? – user unknown Apr 15 '18 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.