Skip to main content

create a PDF file by composing pages from other PDF files.

Project description

What is pdfrecycle?

pdfrecycle creates a PDF file by composing pages from other PDF files. It lets you define PDF bookmarks or put multiple logical pages onto each physical sheet of paper.

pdfrecycle uses a simple text file format to define the layout and what pages to include. From this input file pdfrecycle creates a LaTeX file and then runs pdflatex to produced the PDF file.


pdfrecycle is alpha software and should be expected to have some serious bugs. Use it at your own risk.

pdfrecycle is still under development and the input file format may change in the future.

Any feedback, suggestions or bugreports are welcome.


pdfrecycle needs

  • Python
  • a working LaTeX installation including hyperref` and pdfpages

Usage [options]

valid options are:

--help, -h
show this help message and exit
--input=FILE, -i FILE
read commands from FILE
--output=BASE, -o BASE
use BASE as basename for output
--pages=FILE, -p FILE
read PDF pages from FILE
--runs=COUNT, -r COUNT
run pdflatex COUNT times (default: 3)
--debug=LEVEL, -d LEVEL
set output verbosity

File format

pdfrecycle uses one line per statement. Lines starting with # and lines only containing white space are ignored. The file has to be UTF-8 encoded.

Currently supported statements:


FILE {file}

Use file to get pages from. FILE statements are ignored if the command line has a --pages option.



put a rows and b columns of logical pages onto each physical sheet.


PAGE {page}

Add page number page (physical page number) of the current.


MARK{level} {title}

Add a bookmark on level level with title title. level may be omitted and defaults to 1 (top level). The bookmark is set to the first page of the next PAGE statement.


!{LaTeX code}

Include verbatim LaTeX code. Use this only if you know what you are doing!

If you call pdfrecycle without the --pages option a FILE statement is required before the first PAGE statement


From file slides.pdf use the first page full size and pages 2-30 with 2x2 layout:

FILE slides.pdf
PAGE 2-30

The same as above but add some bookmarks:

FILE slides.pdf
MARK Title


MARK Overview
PAGE 2-3

MARK World domination
MARK1 Plan

MARK2 This room
PAGE 5-10

MARK2 remaining world
PAGE 11-15

MARK Conclusion
PAGE 16-30

Project details

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page