Skip to content

Commit 494f27f

Browse files
committed
Add documentation to merge-pdfs-printable.
1 parent f89725a commit 494f27f

1 file changed

Lines changed: 31 additions & 2 deletions

File tree

‎python3/merge-pdfs-printable.py‎

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,37 @@
11
#!/usr/bin/env python3
2-
#
3-
# Brandon Amos <http://bamos.github.io>
42
# 2014.10.17
53

4+
"""The printers in my office print a cover page before every job, and
5+
I don't like printing many cover pages if I want to submit multiple
6+
papers separately so that the papers don't overlap. This script will
7+
merge PDF documents and insert blank pages so that the printed pages
8+
won't overlap documents. The modulo option is helpful to print 2 PDF
9+
pages per physical page side.
10+
11+
The script uses PyPDF2 to merge the documents and to extract the
12+
number of pages in the input documents and ghostscript to create a
13+
blank PDF page.
14+
15+
$ merge-pdfs-printable.py a.pdf b.pdf c.pdf --modulo 4
16+
a.pdf
17+
+ Pages: 6
18+
+ Added 2 blank pages.
19+
b.pdf
20+
+ Pages: 13
21+
+ Added 3 blank pages.
22+
c.pdf
23+
+ Pages: 13
24+
+ Added 3 blank pages.
25+
Merged output is in '/tmp/tmpm2n5g0mh-merge.pdf'.
26+
27+
Note: Some of my decrypted PDF documents have resulted in
28+
PyPDF2.utils.PdfReadError: file has not been decrypted. My current
29+
workaround solution is to run pdf2ps on the PDF and then ps2pdf on the
30+
PS file.
31+
"""
32+
33+
__author__ = ['Brandon Amos <http://bamos.github.io>']
34+
635
import argparse
736
import os
837
import re

0 commit comments

Comments
 (0)