pdf


How to split a PDF every n page using PyPDF2?


I'm trying to learn how to split a pdf every n page.
In my case I want to split a 64p PDF into several chunks containing four pages each: file 1: p.1-4, file 2: p.5-8 etc.
I'm trying to understand PyPDF2 but my noobness overwhelms me:
from PyPDF2 import PdfFileWriter, PdfFileReader
pdf = PdfFileReader('my_pdf.pdf')
I guess I need to make a loop of sorts using addPage and write files till there's no pages left?

Related Links

Digital signatures in a smart card: Why have two certificates, one for authentication and the other for non-repudiation (signing)? [closed]
Creating PDF in Landscape (Google Apps Script)
Displaying PDF file in JSF with Object tag
filledcurve with terminal pdf looks bad
Increase font for pdf using Inkscape
Optimized conversion of many PDF files to PNG if most of them have 90% the same content
Jasper Reports PDF Export - Displaying SVG image from embedded URL
mupdf render jpeg2000 lose color?
How to set Image as pdf page background
How to Merge PDFs from S3 using ghostscript
PDF Find function does not work
What's the point of embedding Certificate Revocation List in PDF (CRL) rather than have pdf check online?
collapse bookmarks by default in dita 1.8.4
Render partial content of pdf to image
Hyperlink in existing PDF
Extracting text with iTextSharp throws an InvalidCastException

Categories

HOME
mockito
tizen
nullpointerexception
angular-material
relative-path
dot
grep
gis
amortized-analysis
leon
sharepoint-designer
datastax-java-driver
offline
etl
dosgi
http-status-code-504
oxyplot
beyondcompare
google-pagespeed
java-3d
extjs5
tibco-mdm
crystal-reports-2010
opennlp
one-to-many
cas
semantic-analysis
selectedindexchanged
uninstall
elasticsearch-net
google-cloud-nl
delicious-api
nat
calibre
stringtemplate
simplexml
libraries
c11
document.write
streamreader
angularjs-factory
elasticsearch-plugin
email-templates
galen
keydown
gpx
sas-jmp
galleria
fault
paxos
forever
qtwebview
mediaelement
phishing
trash
google-web-starter-kit
storekit
fputcsv
pickadate
rtbkit
wordml
fouc
embedded-code
tableau-online
ibaction
graph-drawing
apache-commons-fileupload
sortedlist
unity5.2.3
block-device
gwidgets
android-imagebutton
relocation
javafx-webengine
uitouch
expected-exception
imdbpy
industrial
cdc
apc
file-locking
rabl
chronoforms
pvrtc
path-separator
nsmanagedobject
deobfuscation
xdomainrequest
sproutcore-2
mirah
fixed-width
phonon
aquaticprime
private-members
post-build
mdac
multiple-languages
ntvdm.exe

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile