How to Extract Pages from a PDF (Mac, Windows, Acrobat, Command Line, or Browser)
Unlike our browser tool, qpdf keeps the order you type, so 7,1 puts page 7 first. Its docs note that document-level data such as bookmarks comes from the primary input, and bookmarks pointing at pages you left out will stop working. Use --empty in place of the input file to drop that data.
With pdftk, separate the ranges with spaces:
pdftk report.pdf cat 1 3-4 7 output extracted-pdftk.pdf
In Python, pypdf’s append takes a list of page indexes, which start at 0:
from pypdf import PdfWriter writer = PdfWriter() # pages 1, 3, 4, 7 are indexes 0, 2, 3, 6 writer.append("report.pdf", [0, 2, 3, 6]) writer.write("extracted-pypdf.pdf")
Real output with qpdf 12.2.0, pdftk-java 3.3.3 and pypdf 7.2.0. The “pages in file” lines read each page’s label with pdftotext.
Other online tools
Smallpdf has an Extract PDF Pages tool that saves your selection as one PDF or as separate files. It’s free with usage limits, and Smallpdf says uploaded files are deleted after one hour. iLovePDF handles extraction inside Split PDF: pick Extract pages, select pages, and tick the box to merge them into one PDF. Its free plan has limited processing, and Premium is $5 a month billed annually or $9 monthly (pricing). Both upload your file to their servers, which is fine for most documents but worth a thought for contracts or medical records.
FAQ
Does extracting pages change the original PDF?
Not with any method here, unless you tick Delete pages after extracting in Acrobat or delete pages in Preview’s sidebar.
Can I extract pages in a different order?
Yes with qpdf, pdftk or pypdf, which follow the order you type. Our browser tool keeps the original order, so reorder the new file afterward if you use it.
Why does my page number not match the page I get?
qpdf, pdftk, pypdf and our tool count pages from the start of the file, not by the numbers printed on them. A document with a roman-numeral front section can be off by several pages, so check the thumbnails.
How do I extract pages from a locked PDF?
You need the password. qpdf accepts it with --password. In Acrobat, Adobe suggests checking File > Document Properties > Security for restrictions before you start.
Can I do this on a phone?
Yes. A browser tool that processes files on the device, such as our extract PDF pages tool, works in a mobile browser.
Cuelark Team
Fuente: Artículo original