Getting the PageNumber Error

Hi, I am getting the page number, I am converting the PDF to Images, But the counter is working fine. It exports the first pdf file to image1 but for a second it’s showing the error. If you see the counter increase to 2.

@Palaniyappan @lakshman

1 Like

Does it have any image like image2.png
Kindly check that
And share the screenshot of the property panel of that export pdf to image activity
The error seems like the page mentioned is not correct and not with the counter variable passed
Kindly check with the page number passed
Cheers @balkishan

1 Like

@Palaniyappan If you on the right side, first pdf name changed and converted successfully and for second same but when it save it showing invalid page number,

Only pdf first converted into image1
image

1 Like

Fine kindly share the screenshot of property panel of that activity
We need to check with the page number mentioned may be that off might not have that such number of pages in it
We need to check that
Cheers

1 Like

@Palaniyappan

1 Like

Kindly check how many pages that pdf actually has

1 Like

There are five pdf in the array bro.

1 Like

No not the number of pdf
Number of pages in each pdf that too in the one which fails now
The reason is it fails because it didn’t that much page number in it
Cheers @balkishan

1 Like

First pdf contains 6 pages and rest are single page bro.
image

@Palaniyappan you there bro.

If I give the 1 in the property then it’s converted fine only the single page bro. but I pass the counter it saying invalid page number!!

why counter is not working here, It’s not constant that documents contain only single page. sometime single sometimes double or more like that so I want to convert all pdf pages.

1 Like

thats the reason as the counter goes beyond page number of 6 as per the counter
its getting failed
either we need to check before with the number of pages and use that as a condition in a if condition
or we need to use a try catchblock for the sequence within (body) inside the for each loop
like
for each loop
trycatch block
–body
–if any exception occurs like this it should go to catch block and there mention like the “pages over” in the log message activity so that it will iterate again in the loop

Cheers @balkishan

1 Like

Bro It’s going into infinity loop.
It convert the first pdf first page only and keep converting the same page only…forcefully I have stop the process. see in the snapshot.

I don’t have these much page in the pdf I have only 10 pages in first pdf I have 6 and rest single page. I put in a Try Catch Block only.

can i have a screenshot of the for each loop if possible
Cheers @balkishan

1 Like

Now it’s convert only the First pdf only not all.
image
image
image
As I have a 7 pages in the first pdf and it converted all 7 pages but not for all PDF

1 Like

no dont keep the full for each loop in try catch block
put only the body of the try catch block
like this
FOR EACH LOOP
–inside the loop TRY CATCH BLOCK ACTIVITY is used
–TRY block put the body container till counter = counter +1
–inside the catch block mention the log message
–so it any exception occurs the iteration will go for the catch and continue with the next file conversion from pdf to image

Cheers @balkishan

1 Like

Now see bro, It converted the all pages for first pdf. Now if it comes for 2nd pdf it shows the error. While there are all 5 pdf in the array.

okay okay understand I am doing that bro.

1 Like

Great
Cheers @balkishan

1 Like

It process all pdf bro but converted only the first pdf. Please see in the snapshot this is first pdf which contains 7 pages only that converted but not for rest of the pdf which I didn’t yellow mark.
image

1 Like

we had five pdfs previously and first one has 6 pages (marked in yello) and rest has 1 page
thats what is coming here right

Cheers @balkishan

1 Like

Exactly bro we have 5 pdf first pdf has 6 pages and rest has single page.
But it convert only the first pdf see here.
image

These are the pdf.
image

1 Like