How do I remove some pages of a .pdf file? I tried some tips mentioned in different websites, but to no avail.
9 Answers
You can use command line tools pdftk and qpdf for this purpose. They are available on Windows and linux.
Use scoop to install them easily on Windows:
scoop install pdftk
scoop install qpdf
Here is the example of the code to keep only pages 1-9 and 26-end of the original file input.pdf and save them to outputfile.pdf.:
pdftk example: (taken from here)
pdftk input.pdf cat 1-9 26-end output outputfile.pdf
qpdf example:
qpdf input.pdf --pages . 1-9,26-z -- outputfile.pdf
-
3
-
1What is the -z parameter for qpdf? Does this refer to the last page, without needing to know the exact number?– shevyMar 29, 2020 at 17:05
-
Yes, z means end page, see here: qpdf.sourceforge.net/files/qpdf-manual.html Mar 29, 2020 at 17:52
-
qpdf
even preserves hyperlinks, which many other tools don't (maybepdftk
does too, but I don't have it installed)– JakobAug 15, 2022 at 23:45 -
I've used PDF SAM (Split And Merge) ( http://www.pdfsam.org/ ) numerous times and it works well.
It's a free Java app, so you will need Java installed. It allows PDFs to be extracted to single pages and then reattached back again.
-
This works fine, I just wish they would add something like Adobe Acrobats "organize pages" were one could easily remove, add, rotate or reorder pages.– FoadJan 8, 2019 at 9:32
-
Visually selecting and then removing pages is now a premium-only feature :-(. Oct 15, 2020 at 12:46
You can use any PDF editor, or if you don't want to download/install anything big, use the command-line portable pdftk (PDF Toolkit). Just extract the EXE and DLL to the same directory as your PDF, then from the command prompt use a command similar to the following:
pdftk in.pdf cat 1-12 14-end output out.pdf
This will delete page 13 from the PDF. See the man(ual) and examples pages for more help/options, or just type pdftk --help
.
-
You can search for PDFTK portable version for a GUI version without installatoin. Jan 3, 2016 at 14:32
-
I wish there were a command to remove certain pages. that would be way more easier IMO.– FoadJan 8, 2019 at 9:32
-
For what's it worth, I found qpdf to work better than the java-based toolkits. Dunno why but I tend to work closer to the C/C++ software stack and oldschool UNIX philosophy. Your mileage may vary, obviously. :)– shevyMar 29, 2020 at 17:05
Another option is to use a PDF printer (e.g. CutePDF ( http://www.cutepdf.com/ ) )
"Print" your PDF to another PDF making sure to choose only the pages you want from the print dialog.
-
2
Sejda is a new "Advanced Online Manipulation Tool" that has the ability to split a PDF document at the page number that you wish. It also has numerous other abilities:
https://www.sejda.com/extract-pdf-pages
To remove pages, use the Extract task. Select all page but the ones you wish removed, and click "Extract".
You can select multiple pages at once pressing SHIFT
Pdf printer drivers, as in Foxit, will convert your original pdf file, but may result in a different quality, or much larger file, when using high quality print.
Alternatively, it is recommended to simply cut off pages, from the original pdf file, without converting it.
This online tool does it very well: http://smallpdf.com/split-pdf
1. Upload your file with drag and drop or press Choose file.
2. Select the pages you want to save into a new file.
3. Press the Split PDF button and download your file.
Another commercial option is using Ricoh's Print&Share:
There are several ways to "remove" pages. Easiest option:
- Print your pdf document or other document to Print&Share
- Go to the Print&Share pages overview by clicking that icon in the upper right corner:
- Deselect the pages that you don't want:
- Click the Send and Close button.
Now it is also possible to deselect pages based on conditions and automatically instead of doing it manually.
This can be for example if the page contains too much color or too much white space or if it contains certain words, or specific page ranges, etc...
The page selection options can be found here:
Removing pages of a pdf
This uses the package pdftk . To Download the file you first pull it off the web.
cd ~
cd Downloads/
wget "https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_free-2.02-win-setup.exe"
Then you install the package
./pdftk_free-2.02-win-setup.exe
To find where the executable file was saved, use the where command
where pdftk
To add the pdftk to your path, add it to ./bashrc and source it
echo 'alias pdftk="C:/Program\ Files\ \(x86\)/PDFtk/bin/pdftk.exe" ' >> ~/.bashrc
source ~/.bashrc
Now cd to the file of interest is
cd /d/Documents/BoxSync/Classes_Spring2021/Advanced_Biostatistics_EEB590C/Lectures/
The actual commands for removing pages are below. The format is "pdftk {input.pdf} cat 1-9 26-end output {outputfile.pdf}" In this example the input.pdf and outputfile.pdf are what you change and the numbers of the pages we are keeping are 1-9 and 26 until the end of the document.
#example
#pdftk input.pdf cat 1-9 26-end output outputfile.pdf
pdftk 10_Multivariate_Association_and_Canonical_Ordination_Methods.pdf cat 1-40 43-end output 10_Multivariate_Association_and_Canonical_Ordination_Methods_altered.pdf
-
2This seems very complicated for a Windows system. In what ways is it superior to the answers already given? Mar 30, 2021 at 21:50
The free foxit reader comes with a pdf printer that allows you to print (ranges of) pages to a pdf file. And it's a great alternative to Adobe Reader.