Skip to content

Instantly share code, notes, and snippets.

@fabianthoma
Created July 25, 2014 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabianthoma/e4ffa0e548fa126e7ace to your computer and use it in GitHub Desktop.
Save fabianthoma/e4ffa0e548fa126e7ace to your computer and use it in GitHub Desktop.
Create PDFs with Contractor

Put all files in /usr/share/contractor and enjoy converting images to PDFs ;)

[Contractor Entry]
Name=Create PDF
Icon=document-convert
Description=Convert to a PDF File
MimeType=image
Exec=/usr/share/contractor/make-pdf.sh %F
X-GNOME-Gettext-Domain=gtk30
#!/bin/bash
printf '%s\n' "$@" | sort -n | tr '\n' ' ' | sed "s/$/\ $(echo $1 | sed -e 's/[\/&]/\\&/g')\.pdf/" | xargs convert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment