J-F-Liu / lopdf

A Rust library for PDF document manipulation.
MIT License
1.61k stars 167 forks source link

[Request] Example of PDF Split #253

Open WCarrollSTO opened 9 months ago

WCarrollSTO commented 9 months ago

Hello, thank you for the library! It has been quite useful for merging PDFs.

I was wondering if we could please have an example of splitting PDF Pages into individual Documents. I've tried writing my own, going by the "Merge" example, but I have had no luck.

Christof23 commented 7 months ago

If you mean going page by page, I've been using doc.delete_pages([1,2,4,5]) to return each page in turn by removing all others.

nb-midwestern commented 1 month ago

I need to do this as well, but I need to split specific sections of a page into a new page, so one page could end up being several pages