News » How to extract pages from PDF on iPad with a-Shell and pdfrw
Posted on 05 Jan 2022 16:42
Using a-Shell and pdfrw
Following this previous tutorial Using youtube-dl on iPad I’ve installed pdfrw, a Python library and utility that reads and writes PDF files.
It came with a lot of examples that let you modify metadata, create booklet, rotate pages, extract pages, add watermark and more. To extract pages I’ve downloaded the subset.py example.
- Install a-Shell from App Store
- Open a-Shell and run the command pip install —upgrade pip to update pip to last version
- Install pdfrw with pip install pdfrw
- Move to a-Shell home folder with cd ~/Documents
- Create bin subfoler with mkdir bin
- Download subset.py to bin subfolder
Usage: subset.py my.pdf page[range] [page[range]] …
eg. subset.py my.pdf 1-3 5 7-9
It creates subset.my.pdf file with pages 1,2,3,5,7,8,9.
You can use other examples to modify your PDFs as you like.
Using Files app
- Open the PDF and tap the share icon
- Select Print
- Tap Range and specify the starting and end pages. Then you can swipe and check the page thumbnail to create a custom range.
- Tap Print.
- Select Save to Files. It will make a new PDF with just the selected pages and save it.
Leave a comment