marker icon indicating copy to clipboard operation
marker copied to clipboard

Page Range feature

Open krainboltgreene opened this issue 1 year ago • 2 comments

It would be extremely helpful to be able to target a specific set of pages for slice converting but also for updating previous attempts at converting (say for a page that was incorrectly or poorly converted).

I would imagine the syntax as (for a document that is 26 pages long):

python convert_single.py --page-range 1,10 a.pdf b.md

This would convert pages: 1,2,3,4,5,6,7,8,9,10

python convert_single.py --page-range 5,6 a.pdf b.md

This would convert pages: 5,6

python convert_single.py --page-range 24, a.pdf b.md

This would convert pages: 24,25,26

python convert_single.py --page-range -4,15 a.pdf b.md

This would convert pages: 23,24,25,26,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15

krainboltgreene avatar Dec 01 '23 20:12 krainboltgreene

I can contribute this with some minor guidance.

krainboltgreene avatar Dec 01 '23 20:12 krainboltgreene

This wouldn't be hard to add. You can look at the max_pages flag as an example. Basically it's passed into this function to restrict the page count. You could instead pass in an array of page numbers.

VikParuchuri avatar Dec 05 '23 21:12 VikParuchuri