Split pdfs

As i have pdf which has 5 pages. I need to split the pdf from page 1 to 3 . 4th and 5th page need to be combined. so that i have 4 pdf as an output.I don’t know how to merge the last two pdf.

Hi @agathiyanv

Try this approach

SplitPDF.xaml (6.6 KB)

Thank you for the code. But the issue is we specify the pagesArr because we know the no.of.Pages .But i need a code that works any pdf and it must join the last two pages.


You can try with pdf page count it wil give you number pages in each pdf for last page pass the output variable and for 2nd for last page, count -1 and pass them to "Extract pdf page range

By using Get pdf page count Activity you will get pages count(counter)

Then Use same syntax(below image) in extract pdf range activity


1 Like

Hi @agathiyanv

Try this

Enumerable.Range(1, PageCount-2).Select(Function(itm) itm.ToString).Append((PageCount-1).ToString+"-"+PageCount.ToString).ToArray

SplitPDF.xaml (6.9 KB)

1 Like

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