Skip to content

Instantly share code, notes, and snippets.

@Mebus
Last active August 29, 2015 14:03
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 Mebus/73cbc18653a4c8e18996 to your computer and use it in GitHub Desktop.
Save Mebus/73cbc18653a4c8e18996 to your computer and use it in GitHub Desktop.
simple example script to join lecture notes with python and pdfjoin
#!/usr/bin/python
import os
def shellquote(s):
return "'" + s.replace("'", "'\\''") + "'"
files = sorted(os.listdir("./"))
shellstring = ""
print "Joining the follwoing files:"
for filename in files:
if not 'Handzettel' in filename and 'pdf' in filename and not 'Druckversion' in filename:
filename = filename.replace(" ", "\\ ")
print filename
shellstring = shellstring+" "+filename+""
print "\n===================\nTo join run \n===================\n\n"
print "pdfjam --fitpaper true --rotateoversize false --suffix joined --outfile joined.pdf "+shellstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment