Didn't see an option in the menus or any documentation on what I imagine is something simple:
I have a multi-page PDF and want to delete a specific page within Okular's GUI.
Didn't see an option in the menus or any documentation on what I imagine is something simple:
I have a multi-page PDF and want to delete a specific page within Okular's GUI.
There is no way to remove a page in Okular. However, it can refresh
modified PDF document automatically so there is no need to re-open the
document manually after modifying it in external tool such as
pdftk. To remove a given page use cat option and specify a range
of pages you'd like to keep in the target PDF file. For example, if
you want to remove 5th page in document.pdf execute the following
command:
pdftk document.pdf cat 1-4 6-end output out.pdf && mv out.pdf document.pdf
If you want an easy GUI solution, I have found PDF Arranger to be really valuable and end user compatible. With it you can merge, join, split, extract, delete and insert single pages from PDF documents, and all using the mouse.
And it's just 300kB.
sudo apt install pdfarranger
I always try to reduce the dependency-trail of my installed packages.
For pdftk I would have to install 16 additional Java dependencies on my Gentoo system ...
So (at least for completeness sake) I wanted to point out, that you can use Ghostscript for this task. It is preinstalled on most Linux systems.
Let's say you want to delete page 2,7,9 and 14 of you document:
gs -sPageList=1,3-6,8,10-13,15- -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dSAFER -sOutputFile=myPDF_out.pdf myPDF.pdf
The trailing dash after 15 indicates, that you want to keep all the pages from 15 to the end of the document.
So if you want to delete only page 5 you would issue:
gs -sPageList=1-4,6- -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dSAFER -sOutputFile=myPDF_out.pdf myPDF.pdf
(Be aware that page numbers have to be in ascending order)
Use LibreOffice "draw" to open the pdf file, delete the pages you want and then EXPORT it as a pdf.....done.
LibreOffice draw didn't work for me, as it munted the formatting. However, Xournal allowed me to remove (and re-arrange) pages while preserving the original document formatting.
If you want to delete pages from the start or end of the document, using Okular:
File > PrintName select Print to File (PDF)Options >>Pages from [_] to [_]Output file as the current filename, if you like. (After writing the file, Okular will reload it automatically.)Print