How can I delete specific pages from a PDF using QPDF?

0
16
Asked By CreativeFox42 On

I'm currently using version 10 of QPDF, and I need to remove three specific pages (90, 95, and 100) from my PDF. I attempted to use the command `qpdf original.pdf --empty --pages . 1-100,r90,r95,r100 -- out.pdf`, but it didn't work. I know that the `x` option is from QPDF 11, so I can't use that. How can I achieve this with my version?

2 Answers

Answered By HelpfulPenguin77 On

To delete pages 90, 95, and 100 using QPDF, you should modify your command to: `qpdf original.pdf --pages . 1-z,x90,x95,x100 -- out.pdf`. This tells QPDF to keep all pages from 1 to the end (denoted by `z`), but to drop pages 90, 95, and 100. Check out the PAGE SELECTION section in the QPDF manual for more details! Good luck!

CuriousMind88 -

I got an error message related to an unexpected character when I tried `1-z,x90,x95,x100`. The help documentation shows ranges like `1-10,x3-4`, but it feels confusing to write. Could you clarify that?

Answered By DiligentOtter24 On

You could also try: `qpdf document.pdf --pages . 1-2 4 6 8- -- output.pdf`. This command will create a new PDF without pages 3, 5, and 7. To delete specific pages, like 120, 122, and 124 from a 130-page PDF, you'd need to keep the others: `--pages . 1-119 121 123 125-130`. It's essential to specify which pages you want to keep!

TaskMaster99 -

Interesting! My PDF has 130 pages too, and I'm curious about how to keep all but those three. So, I can just list the pages I want to keep after 119?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.