/usr/share/doc/python-pdfrw-doc/examples/alter.py is in python-pdfrw-doc 0.2-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #!/usr/bin/env python
'''
usage: alter.py my.pdf
Creates alter.my.pdf
Demonstrates making a slight alteration to a preexisting PDF file.
'''
import sys
import os
from pdfrw import PdfReader, PdfWriter
inpfn, = sys.argv[1:]
outfn = 'alter.' + os.path.basename(inpfn)
trailer = PdfReader(inpfn)
trailer.Info.Title = 'My New Title Goes Here'
writer = PdfWriter()
writer.trailer = trailer
writer.write(outfn)
|