Selecting Pages from a PDF to Make a New (Smaller) PDF
Sometimes small, simple tasks perplex me. Today’s challenge: I’m on Windows 10, and have a 53 page PDF of a journal. I need to make a NEW PDF that only contains pages 26 to 43 (my article) so I can send my article to a researcher who is requesting it. I know you can do this with Acrobat, but I don’t have Acrobat, and still would like to figure out how to make the smaller PDF. Here’s what I learned how to do today:
The Easy Way
- Go to https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
- Find the GREEN button that says “Download PDFtk FREE” and click it
- After the download finishes, right click on the .exe file and Run it
- When the installer starts, click on all the default options all the way through “Finish”
- When installation is finished, go to the search box in the bottom left of your screen
- Type “cmd” and hit Enter to open the terminal window
- Navigate to the directory that contains your original PDF. I first typed D: to get to my auxiliary hard drive, and then cd Scratch to get to D:\Scratch where my full journal PDF was stored.
- Use this code:
pdftk yourlargefilename.pdf cat 26-43 output youroutputfilename.pdf
(replacing YOUR filenames and YOUR starting and ending page numbers instead of 26 and 43)
- Launch a File Explorer window and navigate to the directory you used in Step 7 above. Open the PDF file and check to make sure it contains only the pages you expect.
- There are LOTS more things you can do with PDFtk from the Windows command line, like you did in Step 8. Lots of other options are described at https://www.pdflabs.com/docs/pdftk-cli-examples/
After I finished, I stumbled upon another way that didn’t require downloading a free program, and only uses Google Chrome. (Sometimes those free programs bother me. What a great way to infiltrate computers… offer a totally useful utility completely for free. Consequently, my advice to you is to download it at your own risk. Including these instructions is in no way a guarantee from me that PDFtk is safe.)
The Even Easier Way
- Open Google Chrome
- Type Ctrl-O (that’s the letter O, not the number zero)
- Select the large PDF file that you want to snip
- Your PDF will open in the browser… click on the beginning and ending pages, and capture the page numbers
- Click the print icon in the far upper right corner of your browser
- Click the “Change” button to change destination to “Microsoft Print to PDF”
- Click the second radio button under Pages, and specify the start and end pages separated by a dash (for me, 26-43)
- Click Print, and select a filename for your new, snipped file
- After the PDF is generated, navigate to the directory you saved it in during Step 8. Open the file and check it to make sure the pages are as you expect.
The Sad News
I tried to use the staplr package in R to snip my PDFs, but I couldn’t get it to work. Will try again some other time 😦
Hello Nicole, just checking: did you install pdftk before using the staplr package? https://github.com/pridiltal/staplr
Hi Paul, yep, did that and tested it from the Windows cmd line, but when I tried to call it from within R using staplr RStudio hung on every call (except one that failed with a 127). Maybe a version issue? I haven’t upgraded to R 3.5 yet due to fear of pandoc failing.
Would you consider opening an issue on the pdftk github repo? Hanging is known to happen with some OSX versions when a wrong version of PDFTK is installed but I never saw it on a windows machine. I would love to see what we’re doing wrong