I have a PDF book that I want to remove a few pages from to reduce the file size. My normal solution to this didn't work, and when I tried others they introduced new problems:

  • I usually use PDF Arranger for this, which is normally a great tool. However, when I try it on this particular document I get an error I've never seen before (invalid literal for int() with base 8: b'228')
  • I can use pdftk to remove the pages, but the file size of the resultant document is more than double that of the original, which defeats the purpose of removing the pages in the first place
  • I can also use the Print to File command to remove the correct pages, but then I get a huge margin around the pages, with a smaller font and more whitespace, making the file harder to read

As you can see, it's surprisingly tricky to remove pages while otherwise leaving the document the same. Any advice on other solutions, or figuring out what's going on with these, would be much apreciated!

  • Have you tried community.coherentpdf.com? Commented Apr 15, 2020 at 19:24
  • Hadn't heard of it! I downloaded it but couldn't figure out how to install it. I found the cpdf executable for Linux x64, but when I run it from the terminal I just get a license warning.
    – pez
    Commented Apr 15, 2020 at 19:34
  • Type --help or see the examples on the website: cpdf in.pdf 1-3,12-end -o out.pdf Commented Apr 15, 2020 at 19:36
  • I can't get the cpdf command to be recognized by the terminal.
    – pez
    Commented Apr 15, 2020 at 19:38
  • You have said that you can run it in your previous post. It's not the terminal that recognizes the commands. To run pdf cd to Linux-Intel-64bit or Linux-Intel-32bit and run it ./cpdf Commented Apr 15, 2020 at 19:39

1 Answer 1


It is quite strange that pdftk yields a bigger document in your case. Have you tried the exact following command, taken from here?

pdftk infile.pdf cat 1-r2 output outfile.pdf

(please note that you can change the page selection, following your needs, by specifying multiple ranges as stated in a comment from the link I point to)

If, for some reason, there is no way to avoid pdftk yielding bigger files, you might want to try pdfjam, following that example:

pdfjam infile.pdf <page ranges> --landscape -o outfile.pdf

But bare in mind that pdfjam might want to add extra margins in order to fit a printed page format, unlike pdftk.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .