Created
November 1, 2021 22:07
-
-
Save gnull/622c61311b0987a80e0e6e709f587fb1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -xefu | |
# https://stackoverflow.com/questions/61385594/create-pdf-where-each-page-is-a-merge-of-image-and-a-svg-file | |
# https://stackoverflow.com/questions/501723/overlay-one-pdf-or-ps-file-on-top-of-another | |
# https://superuser.com/questions/381125/how-do-i-convert-an-svg-to-a-pdf-on-linux | |
# http://notesofaprogrammer.blogspot.com/2017/03/converting-svg-to-pdf-on-linux-command.html | |
mkdir -p res/ready | |
for i in $(seq 1 242); do | |
rsvg-convert -f pdf -o res/svg-$i.pdf $i.svg | |
convert $i.jpg res/jpg-$i.pdf | |
pdftk res/svg-$i.pdf background res/jpg-$i.pdf output res/ready/$i.pdf | |
done | |
pdftk $(for i in $(seq 1 242); do echo "res/ready/$i.pdf"; done) cat output result.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment