I found this python script called smpdf that has this feature. This script is written in German (some of it) but it's easy enough to figure out what it's doing and how to use it. It requires PyPdf.
Installation & Setup
First download the script:
svn checkout http://smpdf.googlecode.com/svn/trunk/ smpdf
Then download & install PyPdf:
wget http://pybrary.net/pyPdf/pyPdf-1.13.tar.gz
tar zxvf pyPdf-1.13.tar.gz
cd pyPdf-1.13
sudo python setup.py install
cd ../smpdf
Next I downloaded a sample PDF file from example5.com. Specifically this file.
Usage of smpdf:
[ERROR] Ung�ltiger Aufruf
===========================================================================
PDF Manipulator
(c) 2007 by Franz Buchinger
---------------------------------------------------------------------------
Verwendung:
pdfm split 5 file.pdf Datei file.pdf in PDFs mit jeweils 5 Seiten splitten
pdfm chunk 3 file.pdf Datei file.pdf in max. 3 MB grosse PDFs splitten
pdfm burst file.pdf Jede Einzelseite in file.pdf in ein PDF schreiben
pdfm merge f1.pdf f2.pdf f1.pdf und f2.pdf in ein PDF mergen
pdfm merge output.pdf dir mergt alle PDFs im Verzeichnis dir in die Datei output.pdf
pdfm info f1.pdf zeigt Dokumentinformationen (Groesse, Seitenzahl, Titel,..) zu f1.pdf an
The sample file we downloaded is as follows:
$ pdfinfo chickering04a.pdf
Title: chickering04a.dvi
Creator: dvips(k) 5.94a Copyright 2003 Radical Eye Software
Producer: AFPL Ghostscript 8.0
CreationDate: Fri Oct 8 17:53:18 2004
ModDate: Fri Oct 8 17:53:18 2004
Tagged: no
Pages: 44
Encrypted: no
Page size: 612 x 792 pts (letter)
File size: 386372 bytes
Optimized: no
PDF version: 1.3
So this sample file has 44 pages and is 386KB in size. Using the following command we can split the PDF up into chunk files that are ~0.1MB (~100KB).
python pdfsm.py chunk 0.1 chickering04a.pdf
Which produces the following output:
======== NEUES PDF ========
Seite:0, Groesse: 12696
Seite:1, Groesse: 11515
Seite:2, Groesse: 17209
Seite:3, Groesse: 17411
Seite:4, Groesse: 17060
Seite:5, Groesse: 26303
======== NEUES PDF ========
Seite:9, Groesse: 31014
Seite:10, Groesse: 27666
Seite:11, Groesse: 18548
...
...
======== NEUES PDF ========
Seite:40, Groesse: 19059
Seite:41, Groesse: 20912
Seite:42, Groesse: 17685
Seite:43, Groesse: 5362
Our directory now contains the following files:
$ ls -l
total 1220
-rw-rw-r-- 1 saml saml 74471 May 12 09:23 chickering04a-chunk001.pdf
-rw-rw-r-- 1 saml saml 78673 May 12 09:23 chickering04a-chunk002.pdf
-rw-rw-r-- 1 saml saml 89259 May 12 09:23 chickering04a-chunk003.pdf
-rw-rw-r-- 1 saml saml 92569 May 12 09:23 chickering04a-chunk004.pdf
-rw-rw-r-- 1 saml saml 96953 May 12 09:23 chickering04a-chunk005.pdf
-rw-rw-r-- 1 saml saml 86390 May 12 09:23 chickering04a-chunk006.pdf
-rw-rw-r-- 1 saml saml 90815 May 12 09:23 chickering04a-chunk007.pdf
-rw-rw-r-- 1 saml saml 92094 May 12 09:23 chickering04a-chunk008.pdf
-rw-rw-r-- 1 saml saml 78909 May 12 09:23 chickering04a-chunk009.pdf
-rw-rw-r-- 1 saml saml 386372 May 12 08:30 chickering04a.pdf
-rwxrwxr-x 1 saml saml 9324 May 12 07:41 pdfsm.py
drwxr-xr-x 4 saml saml 4096 May 12 08:25 pyPdf-1.13
-rw-rw-r-- 1 saml saml 35699 May 12 08:24 pyPdf-1.13.tar.gz
I used this "hacked" command to show the stats of the generated PDF files:
$ printf "%7s%6s\n" "# pages" "size"; for i in chickering04a-chunk00*; do pdfinfo $i | egrep "File size|Pages"|cut -d":" -f2;done|sed 's/[\t ]\+/ /'|paste - -
# pages size
5 74471 bytes
3 78673 bytes
3 89259 bytes
5 92569 bytes
4 96953 bytes
3 86390 bytes
5 90815 bytes
6 92094 bytes
5 78909 bytes