Tag Archives: pdf
Make Thumbnails of PDF Pages with ImageMagick
Grab Annotations from a PDF with pypdf2
There are some situations where I don’t have access to my speaker notes. Usually this is a good reason, such as I have mirrored my displays so I can demo or play a video without fiddling with my display settings in the middle of a talk. Sometimes, it’s because something bad happened and I’m presenting from someone else’s machine or a laptop that’s completely off stage and I only have the comfort monitor. For those situations I use a printed set of backup speaker notes so I thought I’d share the script that creates these.
Presenting from PDF
Today: tools for actually delivering a PDF presentation (I make them with rst2pdf ). Continue reading
Scaling and Sizing with PDFJam
pdfjam --suffix converted --papersize '{1920px,1080px}' --scale 0.4 --trim "-6cm -1cm 13cm 8cm" slides.pdf
The --suffix
is instead of giving an output filename, whatever you feed in ends up with the suffix in its filename. This is very handy because I use this command in a script and only need to pass in one variable. The --papersize
isn’t a switch I have used before either but you can set exact sizes for the final output which is nice. The --trim
switch can also be used to set --clip=true
to remove the trimmed space from the document if desired.
I find PDFJam a very handy tool but with not nearly enough blog posts and code snippets around, so I’m dropping my command for future reference (yours as well as mine!).
Splitting And Combining Odd/Even Pages With Pdftk
Hiding Sections With Rst2pdf
Printing Many PDFs Per Page
This weekend I was working on a project which needed a programatically-generated PDF file to be many-slides-per-page – and for this I adopted a tool I haven’t used before: pdfjam (installed straight from apt on Ubuntu).
In fact it was pretty easy to get going with it: to print my existing PDFs at 4-per-page, I used this command:
pdfjam --landscape --nup 2x2 --a4paper -q slides.pdf -o handout.pdf
The slides themselves were already landscape so I specified the target document should also be landscape. The --nup 2x2
is the magic that prints many slides per page, and it seems like it can do various nice tricks with handouts. Running through the other arguments that I used: --a4paper
for the paper size, -q
to stop it from chattering (which it does by default, even when everything worked), slides.pdf
was my input file and -o handout.pdf
the target file to put the new layout into.
Until now I’ve mostly worked with pdftk for everything, but I couldn’t find a way to do this using it. Pdfjam is now a welcome addition to my PDF toolchain, so I thought I’d share.
Printing PDF Bookmarks List
I used a tool called pdftk which is excellent, I’ve used it before for doing various other PDF-related things. To grab metadata such as bookmarks, use the dump-data command, like this:
pdftk myfile.pdf dump_data | grep BookmarkTitle > outline.txt
The above line takes all the bookmarks from the PDF (this was a slide deck created using powerdot and LaTeX, the section and slide titles nest appropriately), and outputs a bunch of information about the document and the various PDFs. The grep
command just gets the lines containing “BookmarkTitle”, then the whole thing gets written to a file. I cleaned that up and now I have the outline of my course, so I can add timings, notes for the exercises and so on.