Hi …i have a requirement like i need to delete some selected pages from pdf.can any one help me
Sure, I can help you with that. Here’s an overview of the steps to delete selected pages from a PDF using UiPath:
- Install the UiPath.PDF.Activities package from the UiPath Marketplace.
- Use the “Read PDF Text” activity to read the page numbers you want to delete from the PDF.
- Use the “Delete Pages” activity to delete the selected pages from the PDF.
- Use the “Save PDF Document” activity to save the updated PDF.
Here are some more details on each step:
- Install the UiPath.PDF.Activities package: To install this package, follow these steps: a. In UiPath Studio, go to the “Manage Packages” option from the “Activities” panel. b. Search for “UiPath.PDF.Activities” and click on the “Install” button. c. Once the package is installed, you can start using the activities in your workflow.
- Use the “Read PDF Text” activity: Use the “Read PDF Text” activity to read the page numbers you want to delete from the PDF. You can extract the page numbers using regular expressions or string manipulation. Store the page numbers in a variable.
- Use the “Delete Pages” activity: Use the “Delete Pages” activity to delete the selected pages from the PDF. Pass the PDF file path and the page numbers you want to delete as input to this activity.
- Use the “Save PDF Document” activity: Use the “Save PDF Document” activity to save the updated PDF. Pass the updated PDF file path as input to this activity.
That’s it! Your UiPath workflow should now be able to delete selected pages from a PDF file.
Hi Nitya thanks for your response.i will use the same.
Welcome to the community
You can use extract pdf with page range as below
This will extract pages 2 to 5 ,7 and 10 to end of doc as one file
i.e., it would remove 1,6,8 and 9
Delete pages activity not available for me
Please try the above mentioned approach…it should do the work for you
I need to delete pages from pdf in dynamic format… suppose i hav pdf with 100 pages .bot will check the invoice number where ever maths found it will add the that page to the list.suppose in the first iteration it matches 4 and 99.so i need to extract the pdf using4 and 99 page and then delete 4 and 99 this is first iteration.i need to repeat the same till last page… delete
Then use read pdf in a loop and increment the page number field and read each page…check for the key word…if key word present save the page number…to a list of page numbers…
And after the loop use extract pdf and provide input as
Now all the pages which are identified are extracted as you need
Hope this helps
if requirement is like
Read pages which invoice numbers are present and later get pdf pages which are not extracted
Firstly get number of pages and then convert the range to array say PdfPageNos by
1.Loop through the invoice numbers list
2. get page numbers and extract the data for particular invoice no. then add the page no. to array say DeletePages
3.after loop is completed Now get RemainingPages by using
Finally use extract PDF activity and provide the String.Join(“,”,RemainingPages) as input
I gave it a try and it doesn’t look like this activity exists:
Could you please share how you arrived at this solution?