My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/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

import find_pdfrw
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)

Change log

r77 by pmaupin on Nov 30, 2009   Diff
Added ability to make slight modifications
to existing PDFs,
and alter.py to demonstrate it.
Go to: 
Sign in to write a code review

Older revisions

r75 by pmaupin on Nov 30, 2009   Diff
Simplified trailer interface
r73 by pmaupin on Nov 30, 2009   Diff
Made PdfWriter a little more
functional.
Added metadata example.
r43 by pmaupin on Nov 27, 2009   Diff
Fixed booklet printing to work
properly on odd pages.
Added subset example.
All revisions of this file

File info

Size: 433 bytes, 25 lines

File properties

svn:executable
*
svn:mergeinfo
Powered by Google Project Hosting