Extract a page from a pdf flle

Both your command lines work for me, and the second matches @ajgringo619's comment. Try adding --verbose to the second one? Try page 1?

Commented Mar 21, 2023 at 3:15

4 Answers 4

The magic combination of options is qpdf --empty --pages infile.pdf 1-5 -- outfile.pdf .

answered Dec 26, 2020 at 5:18 2,151 2 2 gold badges 35 35 silver badges 65 65 bronze badges

On Ubuntu I use Evince for PDFs, and I use the normal print dialog for extracting pages. In the printer selection, I have an option "Print to file". Then there is the field where I can enter which pages I want to be "printed". The result is a saved .pdf file.

answered Dec 26, 2020 at 3:12 4,197 4 4 gold badges 25 25 silver badges 42 42 bronze badges

Both your command lines should work, try adding --verbose to the second one ( qpdf --verbose 0092434747.pdf --pages . 10 -- mtg.pdf ) to see why it's failing. They name a primary input file, so as the qpdf docs say "Document-level information, such as outlines, tags, etc., is taken from the primary input file". A 'dot' works as a file name because "You can use . as a shorthand for the primary input file, if not empty,"

If you don't want any document information from your input file, you can start with an empty file and select page(s) from your input file:

qpdf --empty --pages infile.pdf 10 -- outfile.pdf 

Be careful, qpdf will overwrite existing files without warning, so work with a copy of your file(s) unless you're sure what you're doing.

answered Mar 21, 2023 at 3:31 313 3 3 silver badges 8 8 bronze badges

pdftk

For your case would be pdftk input.pdf cat 10-10 output output.pdf .

# tldr:pdftk # pdftk # PDF toolkit. # More information: . # Extract pages 1-3, 5 and 6-10 from a PDF file and save them as another one: pdftk input.pdf cat 1-3 5 6-10 output output.pdf # Merge (concatenate) a list of PDF files and save the result as another one: pdftk file1.pdf file2.pdf . cat output output.pdf # Split each page of a PDF file into a separate file, with a given filename output pattern: pdftk input.pdf burst output out_%d.pdf # Rotate all pages by 180 degrees clockwise: pdftk input.pdf cat 1-endsouth output output.pdf # Rotate third page by 90 degrees clockwise and leave others unchanged: pdftk input.pdf cat 1-2 3east 4-end output output.pdf