https://github.com/stuartpb/debrochure-pdf
A Bash script that undoes double-sided billfold formatting in PDFs
https://github.com/stuartpb/debrochure-pdf
Last synced: 8 months ago
JSON representation
A Bash script that undoes double-sided billfold formatting in PDFs
- Host: GitHub
- URL: https://github.com/stuartpb/debrochure-pdf
- Owner: stuartpb
- Created: 2017-09-26T05:53:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-26T06:02:06.000Z (over 8 years ago)
- Last Synced: 2025-07-26T07:07:42.178Z (11 months ago)
- Language: Shell
- Size: 1000 Bytes
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# debrochure-pdf
This is a Bash script that takes a PDF formatted for double-printed brochure pages (where the left side of the first page is the back cover, the right side of the first page is the front cover, the left side of the second page is the inside front cover, the right side of the second page is the inside back cover, the left of the third page is the back of the last inside page, the right of the third page is the front of the first inside page, and so on) and reformats it as a document where each in-book page has its own in-PDF page.
It makes use of two separate tools to accomplish this:
- `mutool` (avalable in the `mupdf-tools` package on Ubuntu), for splitting the pages in half
- `pdftk` (avalable in the `pdftk` package on Ubuntu), for splitting and re-merging the individual pages into separate files for re-numbering
Ideally, this would all be put into one GhostScript script (maybe using [this StackOverflow answer](https://stackoverflow.com/a/14497102/34799) as a base), rather than calling out to tools from *two separate PDF manipulation packages* to accomplish what is, all things considered, a pretty simple task. However, figuring out just how to do that would require more time learning about PDF manipulation toolchains than I really care to spend.
## Usage
```sh
./debrochure-pdf brochure.pdf
```
This will create a new file called `brochure-sp.pdf`.