PDF to TXT with page count

Hello

I want to convert pdfs into txt documents.
I use the “Read PDF Text” from the pdf activities package to create the txt files.

Is there a way to write END PAGE after each page ?
I used the the preserve formating to keep the pagecount but it only works when the text inside the pdf has a page count.

Or is there a way to write into the pdf file after each page and then make a copy ?

Any tips on packages or general structure I could use ? Feel like I need to move from StudioX to normal Studio :sweat_smile:

You can try the following logic:

  1. Get number of pages from pdf
    https://docs.uipath.com/activities/docs/get-pdf-page-count
  2. Split each page into pdf
    https://docs.uipath.com/activities/docs/extract-pdf-page-range
  3. Extract each pdf/page to a string
  4. Add at the end of the string “END PAGE”
  5. Append each string to the txt file
2 Likes

Nice Idea!

I will save the pagecount into an Excel file,
and then get the number for the extract pdf file operation from this file.

Hi @Nils_Berns - I have worked almost similar one recently , but it was in Studio not studioX. So let me know, if you are ok with Studio I will try to adjust few things in the workflow …

1 Like

Hi prasath17
sounds interesting to me !

Hi @Nils_Berns …I have tried it studioX and I got the results…

Splitted PDF Files and Extracted Text files…

Final Out - Text files with added End Of Page( on all the text files)

1 Like

Awesome!

I still have some problems but i will tinker along a bit and will then write something more.

What did you insert under 3.1 in the range field ?

Hi @Nils_Berns

Range: Current Item

Since this value increment from 1 to N Pages.
Idea is to Split each pages, convert it to Text and finally append the “End of the page” text.

Output File Name: I have used the same in the output file Name also

image

1 Like

Hi @Nils_Berns - Please find the attached xaml AddText_PDF.zip (2.1 MB)

Hope this helps. If this solves your query, please mark my post as solution.

1 Like

Thank you. This solution saves 100 of hours to the current robot I use.

1 Like

Hi @Nils_Berns … Glad to know. Thanks.

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