KitzKikz  KitzKikz: PdfTonto   RecentChanges 
 PopularPages 
 SearchPages 
 Home | Trail - PdfTonto
 

  I'm not finished with the introductory text yet, so here is some filler ["Lipsum" http://www.lipsum.com]. %%%
Scroll down to get the full documentation.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam sagittis elit ac mi. Donec faucibus lectus ut lectus. Sed tempus odio eget metus. Morbi congue blandit magna. Cras neque nibh, cursus eget, vulputate sit amet, cursus sed, mauris. Phasellus lorem. Sed consectetuer adipiscing lorem. Proin lectus nisi, auctor vitae, porttitor ac, elementum quis, tellus.

''Ut eu odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque rhoncus aliquam orci. Cras dignissim nulla eu enim. Etiam diam. Maecenas neque. Mauris quis massa. Fusce lobortis lectus et nulla. Aenean felis pede, pellentesque vel, vehicula vel, pretium non, risus. Vivamus odio lorem, placerat ac, consectetuer ut, aliquet vitae, libero. Quisque blandit sodales nisl. Nunc ac odio.''

In hendrerit. Vivamus sed nisi sit amet massa porta viverra. Praesent tempus laoreet ante. Integer eget odio. Phasellus a diam non nulla rutrum varius. Nulla facilisi. In eu ligula. Nunc placerat mauris condimentum magna. Nullam eget pede at magna mollis sagittis. Cras egestas arcu quis erat.
#ManPageRef

!Platforms
- Any that can run perl programs.
- Tested successfully on Mac OS X & Linux

!Requirements
- Perl
- Ability to use command line interface #ManPageRef
<!--ewiki_col_break

__##[Download | KitzKikzDownloads]##__ %%%
[Manual Page | #ManPageRef] %%%
PdfTontoFAQ %%%
PdfTontoIssues %%%
[History | #HistoryRef] %%%

<!--ewiki_page_break

__NAME__ #NameRef
pdfTonto - Arrange pages of a PDF for easier printing of books

__SYNOPSIS__ #SynopsisRef
pdfTonto ![options] < input.pdf > out.pdf

Required Options (at least one is required):
--pages page-list : ''List of pages to extract'' %%%
--filter name : ''Arrangement filter to use''

Other Options:
--in filename : ''Get input from filename instead of standard in'' %%%
--out filename : ''Write to filename instead of standard out'' %%%
--sig N : ''Signature size. Only used by some filters'' %%%
--help, -? : ''Display more help info'' %%%
--man : ''Display full man page''

__DESCRIPTION__ #DescriptionRef
Extracts a given set of pages from a pdf and rearranges them in an
order useful for printing in a book format.

Pages can be arranged for easy folding of a 2-up layout to make booklets.

Pages can be arranged for cutting the 2-up layout in the middle and
placing one half on top of the other without the need for hand collating.

Print the front side or the back side independently, for printers that
can't print on both sides of the paper. The back side can be printed in
reverse order if needed.

__OPTIONS__ #OptionsRef
__--pages__ ''page-list'', __-p__ ''page-list''
The list of pages to extract from the input PDF. Use commas to
separate pages or ranges and use a dash to specify a range (i.e.
1,3,6-12). Pages can be put in any order and can even be repeated
(i.e. 15,30,17,7,17,0). Use page number zero to put a blank page
in that position. If the __--pages__ option is not used, then all
pages in the input PDF will be passed to the __--filter__. Either one
or both of __--filter__ and __--pages__ must be used.

__--filter__ ''name'', __-f__ ''name''
The filter to use on the extracted pages to rearrange them for
printing. See the man page for a list of existing filters and
their explanations. If the __--filter__ option is not used, then pages
are written to the output PDF in the exact order given in the
__--pages__ option. Either one or both of __--filter__ and __--pages__ must be
used.

__--in__ ''filename'', __-i__ ''filename''
The PDF file to use as the source. Defaults to the standard input
if not specified.

__--out__ ''filename'', __-o__ ''filename''
The PDF file to write the results to. Defaults to the standard
output if not specified. Will overwrite the file if it exists.

__--sig__ ''N''
Specify the number ''N'' of sheets that make up a signature (sub-book
let) for filters that support them. Defaults to no signatures.
Signatures is a technique useful for binding books larger than a
few dozen pages.

__--help__, __-?__, __--man__
View the help text

__FILTERS__ #FiltersRef
__booklet__
For 2-up layout printing. Arranges pages so that the sheets can be
folded and proper page order is maintained. Supports the __--sig__
option. For booklets of more than a few dozen pages, signatures
are recommended.

__booklet_front__
Same as booklet, but only outputs pages for the front side of each
sheet. Use for 2-up printing on printers that only print on one
side of the paper.

__booklet_back__
Same as booklet, but only outputs pages for the back side of each
sheet. Use for 2-up printing on printers that only print on one
side of the paper. Depending on how the printer outputs sheets,
booklet_back_reverse may be needed instead.

__booklet_back_reverse__
Same as booklet_back, but prints in reverse sheet order.

__slice_stack__ %%%
__slice_stack_front__ %%%
__slice_stack_back__ %%%
__slice_stack_back_reverse__
For 2-up layout printing. Arranges pages so that the entire stack
can be sliced in half, the left stack can be placed on top of the
right stack, and all the pages will be in order. If the printer
does not support printing on both sides of the paper, use the
front, back, and back_reverse variants.

__4up_front__ %%%
__4up_back__ %%%
__4up_back_reverse__
For 4-up layout printing. Useful if the target printer doesn't
duplex (print on both sides). First use 4up_front to print, then
turn the stack over and feed it through again using either 4up_back
or 4up_back_reverse (depending on how the printer outputs the
paper).

__EXAMPLES__ #ExamplesRef
Capturing a range of pages from a larger PDF and sending them as a
booklet directly to a printer using CUPS. The printer supports 2-up
layout and printing on both sides:
<pre>
pdfTonto -i in.pdf -p 34-86 -f booklet | \
lp -d printer-name -o sides=two-sided-short-edge -o number-up=2
</pre>
Using the same range of pages in booklet form, but sending them to a
printer that can only handle single sided printing. This will require
two passes of the paper through the printer:
<pre>
pdfTonto -i in.pdf -p 34-86 -f booklet_front | \
lp -d printer-name -o number-up=2
pdfTonto -i in.pdf -p 34-86 -f booklet_back | \
lp -d printer-name -o number-up=2
</pre>
Save the page range in slicestack form so you can take the PDF to work
and print it on a high quality duplex printer, use the large vertical
paper cutter to trim the pages, and use the plastic-comb binding
machine to put them all together in a nice book. What? Don't you have
those where you work?
<pre>
pdfTonto -i in.pdf -p 34-86 -f slicestack -o out.pdf
</pre>

__CAVEATS__ #CaveatsRef
__N-up Printing__
pdfTonto does not actually resize, rotate, and combine multiple
input pages onto a single output page. It only reorders the pages
so that they'll come out of the printer correctly for binding into
a book. Your printer and driver still need to print in 2-up or
4-up mode. If your printer does not support N-up printing, then
you have bigger problems than reordering the pages of a PDF.

__File Size__
pdfTonto takes advantage of the "Incremental Update" feature of
Adobe's PDF Specification. It only writes the new page directory
to the end of the file. This is a much faster method than rewriting the entire PDF from scratch. This also means that the output
PDF file will not reduce in size, even if you are sampling 10 pages
out of a 1200 page PDF.

If you need to have a smaller file (so it will fit on a flash
drive, for example), open the output PDF in a viewing program, such
as Preview in Mac OS X, and use "Save As..." to create a new copy.
The program will rewrite the PDF from scratch, omitting any data
not referenced by the page directory created by pdfTonto.

__RESTRICTIONS__ #RestrictionsRef
This script will not read PDF's containing Cross Reference Streams
added at version 1.5 of Adobe's PDF Specification. If there is enough
demand for it, I may look into adding that additional feature.

For the few PDF's I've come across using Object Streams, I simply
opened them in a viewing application (Mac OS X Preview) and chose "Save
as...", which rewrote the PDF in a format without the compressed
streams. I then used pdfTonto on that second PDF with no troubles.

pdfTonto will not work with encrypted PDF files.

__NOTES__ #NotesRef
A Tonto is a type of Japanese knife or dagger. Tonto also means
"idiot" in Spanish. Either one of these could explain the name
"pdfTonto". However, I originally wanted to call this "pdfArranger",
but that was too close to a couple of other programs out there. So,
the thought process went like this:

pdfArranger...A Ranger...Lone Ranger...Tonto...pdfTonto

Now you'll never forget it, ["Kemo Sabe" http://www.old-time.com/misc/kemo.html] :-)

<!--ewiki_col_break

["NAME" #NameRef] %%%
["SYNOPSIS" #SynopsisRef] %%%
["OPTIONS" #OptionsRef] %%%
["FILTERS" #FiltersRef] %%%
["EXAMPLES" #ExamplesRef] %%%
["CAVEATS" #CaveatsRef] %%%
["RESTRICTIONS" #RestrictionsRef] %%%
["NOTES" #NotesRef] %%%

<!--ewiki_page_break
!!!Version History #HistoryRef
;__Version 1.1__:Outputs a blank page for requests that are outside the page range of the input PDF. %%% This would have created an unreadable PDF otherwise.
;__Version 1.0__:Initial Version
 

 
  ·  0.1022s