How to delete last page from PDF before extraction?

Hello,

I need to delete the last page from each PDF in a folder before the PDFs are digitized and data is extracted. The PDFs vary in length so sometimes it’s page 2 of 2 that needs to be deleted, sometimes page 3 of 3 or page 4 of 4, etc.

I installed the UiPath.PDF.Activities package but there is no Delete Page activity.

Thank you.

Hey @Laura_Hubbard

you may use the combination of two PDF activities:

  1. Get PDF Page Count: Extract the count of pages per PDF
  2. Extract PDF Page Range: Extracts the amount of pages that you select

So what you have to do is the following:

  1. Get PDF Rage Count - save an int Variable
  2. Extract PDF Range - use that variable, decrement it by and convert it to a string (this is what the Extract PDF Range activity expects (i_pageCount - 1).ToString

Sincerely
Luca

2 Likes

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