Sunday, September 6, 2015

Deleting a page of a pdf file in Ubuntu

Suppose you have a pdf file with many pages and you want to delete a single page (or a list of pages) from this file in Ubuntu. You can first install the pdftk package using Ubuntu's package manager or by simply typing

sudo apt-get install pdftk

in the command line.

Now think that you want 4th page to be excluded from the pdf. You can type

pdftk old.pdf cat 1-3 5-end output new.pdf

where the original pdf is old.pdf, new.pdf is the new one with 4th page is excluded.

Hope this helps.