You are not logged in.

#1 2016-09-23 02:31:33

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,522
Website

svgtools: utilities for svg files and JessyInk presentations

Project page: http://xyne.archlinux.ca/projects/svgtools/
AUR page: https://aur.archlinux.org/packages/svgtools/

I ended up writing some tools out of necessity. I've dumped them in a package in case anyone else finds them useful. The collection will likely grow over time. The package contains the following.

svg-img_mgr
A command-line utility for managing linked and embedded images in an svg file. It can

  • List all images in the file (and check if linked images exist at the link's location).

  • Extract linked and/or embedded images to a directory and optionally update the svg to use this new directory. This lets you de-duplicated embedded images and reduce the svg size and saves you the trouble of finding the images manually. It's also useful for creating a clean working directory after accumulating images in the local directory.

  • Embed linked images. This makes the svg fully portable. You can extract the images later at the destination.

  • Rename linked images. This can move/copy linked images on the disk and update the svg to point to the new location. It's useful for renaming extracted images, which are named after their checksum by default.

  • Scrub unwanted metadata from the file. For now this just deletes Inkscapes absref attributes ("sodipodi:absref") that store absolute paths in the file. Nobody needs to know your local directory hierarchy when sharing SVG files.

  • Various JessyInk commands, the most important of which is a command to export each JessyInk slide as a separate SVG file directly from the original SVG file, with support for selective exports.

(This script has been converted to an executable Python 3 module named SvgImgMgr and installed accordingly. svg-img_mgr is now just a wrapper to invoke the module.)

ji2pdf
Extract slides with svg-img_mgr, render them with Inkscape and then join them with pdfunite.

jessyink_to_slides
Extract slides using PhantomJS and then render them with Inkscape.

Last edited by Xyne (2016-09-24 02:14:32)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#2 2016-10-10 16:06:58

CjK
Member
Registered: 2008-10-17
Posts: 20

Re: svgtools: utilities for svg files and JessyInk presentations

Thanks for making those tools available. Helped me in handling SVG images for an App I'm writing!

Offline

#3 2016-10-12 19:15:09

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,522
Website

Re: svgtools: utilities for svg files and JessyInk presentations

I'm glad they were useful. Thanks for the feedback!


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#4 2017-02-28 07:02:28

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,522
Website

Re: svgtools: utilities for svg files and JessyInk presentations

New sub-command: deduplicate

Scan the SVG document for duplicate linked and embedded images. For each set of duplicates, if there is at least 1 linked image, all of the duplicates will updated to link the same external image, including any embedded images. If there are duplicates of the same image with different paths then the user will be prompted to select one of them.

At some point I will likely add options to automatically select an image instead of prompting the user, restrict the deduplication to user-selected images, and maybe find a way to deduplicate embedded data (I need to read up on SVG definitions to see if/how they can be used for image data).

*carefully slips out without disturbing more dust*


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2020-07-27 02:22:57

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,522
Website

Re: svgtools: utilities for svg files and JessyInk presentations

Just a heads-up that ji2pdf has changed following a bug report and some feature suggestions. See the changelog and "ji2pdf -h" for details.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB