User:Simon/Trim4/PDF imposition: Difference between revisions
No edit summary |
|||
Line 10: | Line 10: | ||
First, I'm working out which commands to use from the command line. The process should be as follows:<br> | First, I'm working out which commands to use from the command line. The process should be as follows:<br> | ||
#burst the source PDF | #burst the source PDF, keep the name of the source plus page number (-%d) | ||
$ pdftk source.pdf burst output source-%d.pdf | $ pdftk source.pdf burst output source-%d.pdf | ||
#resize the resulting burst single page PDF | #resize the resulting burst single page PDF | ||
$ magick mogrify -resize 50% | $ magick mogrify -resize 50% source*.pdf | ||
#or | #or | ||
$ magick mogrify -resize 256x256 *.pdf | $ magick mogrify -resize 256x256 source*.pdf | ||
#impose 2up on a page using imagemagick montage command | #impose 2up on a page using imagemagick montage command | ||
#assemble imposed PDFs into a single file | #assemble imposed PDFs into a single file |
Revision as of 16:22, 24 September 2019
Hackpact 1: PDF imposition
Premise: I will write my own script(s) to impose pages from a source PDF:
The aim is to write a Python script to automate the process by iterating recursively over pages in a PDF. These will be called in Python as subprocesses using the subprocess module.
24.09.19
First, I'm working out which commands to use from the command line. The process should be as follows:
#burst the source PDF, keep the name of the source plus page number (-%d) $ pdftk source.pdf burst output source-%d.pdf
#resize the resulting burst single page PDF $ magick mogrify -resize 50% source*.pdf #or $ magick mogrify -resize 256x256 source*.pdf
#impose 2up on a page using imagemagick montage command
#assemble imposed PDFs into a single file