mce
(Maic Ceriani)
August 11, 2023, 10:11am
1
How can I split a pdf containing multiples pages into several files? I want to split each 2 pages = 1 PDF document
Example here (there are 12 pages)
I want to have 6 files (so page 1 and 2 = 1 file) (page 3 and 4 = another file ) etc…
Is that possible? Which activities to be sued in order to do that?
Vikas_M
(Vikas M)
August 11, 2023, 10:16am
2
Hey @mce ,
You can use a package from the marketplace
BalaReva.Pdf.Activities
This has a feature of PDFsplitter
Hope it helps you out
ppr
(Peter Preuss)
August 11, 2023, 10:19am
3
We Assume: Project Compatibility is Windows
retrieve the page count:
Create range series - myRanges
we will dynamize it with the pageCount Variable. Also can handle even/odd cases properly
Then we loop over myRanges and using the looped value here:
1 Like
rlgandu
(Rajyalakshmi Gandu)
August 11, 2023, 11:16am
5
@mce
In properties of extract pdf range of “Range”:(init_PageCount-1).ToString &“-”&(init_PageCount).ToString
mce
(Maic Ceriani)
August 11, 2023, 12:22pm
6
Rigandu,
I try to use your method but I obtain the following error message
What did I do wrong?
Thanks in advance for your help.
rlgandu
(Rajyalakshmi Gandu)
August 11, 2023, 12:25pm
7
@mce
Give the destination path as “Test”+(init_PageCount-1).ToString &“-”&(init_PageCount).ToString+“.pdf”
mce
(Maic Ceriani)
August 11, 2023, 12:47pm
8
I still have the problem (see below)
Hi @mce ,
For the error received, it is already recorded and the fix is already mentioned :
This topic describes troubleshooting guide regarding conversion from Windows-Legacy project to Windows project as of Dec 2022. Hope this helps those who face these problems.
1 Quick Reference by Error Messages, Situation etc.
Phase
Error message / Situation
Reference
Open project
foobar.xaml: Cannot create unknown type’{clr-Namespace:UiPath.foo.Activities;assembly=UiPath.bar.Activities}ActivityName’.
2.2 Missing Activities package OR 2.3 Missing activity
Development
Unable to set pro…
postwick
(Paul Ostwick)
August 11, 2023, 1:14pm
10
In the UiPath.PDF.Activities package (official not third party) there is a Extract PDF Page Range. You could loop over that to split it into the pages you want.
rlgandu
(Rajyalakshmi Gandu)
August 11, 2023, 1:48pm
11
@mce
Remove parenthesis and run the workflow
Parvathy
(PS Parvathy)
August 11, 2023, 3:01pm
12
Hi @mce
Follow this YouTube video. You will find the solution for splitting the PDF’s.
Hope it helps!!
mce
(Maic Ceriani)
August 16, 2023, 8:47am
13
This doesnt work as well.
I have tried to build this differently and I’m almost there (I can split each 2 pages together but once splitted I have the following error message :
Do you have an idea why I obtain this error message?
variables used :
Thanks in advance for the help
rlgandu
(Rajyalakshmi Gandu)
August 16, 2023, 9:04am
14
@mce
Initialise intCurrentPage to 1
mce
(Maic Ceriani)
August 16, 2023, 9:16am
15
This is worst if I put Intcurrentpage to 1 => I still have the same error message and the output are not correctly splitted each 2 pages.
Do you have another idea?
ppr
(Peter Preuss)
August 16, 2023, 9:21am
16
we shared above and also show cased:
ppr:
Create range series - myRanges
we will dynamize it with the pageCount Variable. Also can handle even/odd cases properly
Then we loop over myRanges and using the looped value here:
rlgandu
(Rajyalakshmi Gandu)
August 16, 2023, 9:26am
17
@mce
I think the error is in the while loop condition so change the comparision operator
Instead of <= give = only
mce
(Maic Ceriani)
August 16, 2023, 9:40am
18
This is not the solution as I can have a file with 12 pages another one with 34 pages the other one 44 etc…
mce
(Maic Ceriani)
August 16, 2023, 9:41am
19
In my opinion I have to keep intCurrentPage <=intTotalPageCount otherwise nothing happens if I remove the symbo < and only keep =. Do you have anothe solution ?
ppr
(Peter Preuss)
August 16, 2023, 9:51am
20
we mentioned that it will be dynamized with a variable. Also we used the get pdf page count activity for getting the current page count.
So we can do, using myPageCount Variable and mySegment Variable:
mySegment | Int32 = 2
Pagecount = 12 | even
PageCount = 13 | odd
So, we dont see any blocker, when working dynamic with variables as already mentioned, when presented
mce
(Maic Ceriani)
August 16, 2023, 10:10am
21
Can you help tell me how to create range series ?