How to split a pdf every 49th(configurable) page?

So i want to use the

UIPathPDFActivities.ExtractPDFPageRange

to split a PDF into multiple PDF’S,

Issue

my issue is, source pdf page changes and some time i need to split it at every 49, sometime every 80 etc, so how can i dynamically set this to where i can give any “splitAT” number and the activity do the split accordingly with help of some kind of divisible and loop i assume.

example 1 - source pdf have 99 pages and page Split at is given as 80, BOT will create a pdf with first 1-80 pages, then create another pdf with 19 page (81-99).

example 2 - source pdf have 259 pages and page Split at is given as 49, BOT will create a 5 pdf with 49 pages, then create another pdf with 14 page (245-259)

This is what i have so far: doing some math with total count , fix integer divide , kind of work with bugs and issues, please look and improve my code
SplitPDF.xaml (13.6 KB)

@Jay_Chacko - I have splitted the pdfs based on the text …

Say…if the pdf is 10 pages and the text found in 4 & 7…My code will create a page range of 1-3, 4-6, 7-10 pass it to "Pdf Splitter(bala reva Activity)…which will create 3 pdfs in one shot…

I have to poke around my code to try your scenario.

1 Like

have a working solution, please look and improve my code if needed

SplitPDF.xaml (19.1 KB)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.