View Single Post
Old 03-27-2015, 01:35 AM   #6
gmer
Junior Member
gmer began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Mar 2015
Device: android
Here is a bash script that does a direct conversion without having to 'print' them. It relies on hxselect, inkscape, and pdfunite which are commonly found in most Linux repos. Use it by passing the directory containing index_svg.xhtml as the first argument and it will generate a pdf subdirectory.

Code:
#!/bin/bash
mkdir $@/pdf

for f in $@/svg/page*html
do
	file=${f##*/}
	shortname=${file%%.xhtml}
	echo "processing $shortname"
	(cd $@/pdf ; cat ../svg/$file | hxselect '#svgimg' | inkscape -f /dev/stdin -A $shortname.pdf 2>/dev/null)
done

pdfunite $@/pdf/* $@/pdf/joined.pdf
gmer is offline   Reply With Quote