I am trying to extract text from a PDF file and convert it to the PDF File name. I have attempted using the Lesson 10 PDF Extraction using the Anchor Base, but it never recognizes the file as the “company name” (i.e. like in the example when it pulls Grand Total and $40.00) What is the best way to rename a pdf document?
Welcome to UiPath Community buddy…
Great…lets sort this out,
Kindly refer this image,
1.Take a sample pdf and place it in a folder, and extract text from a PDF file you want… Save it to a variable. Then use MOVE FILE activity, where in property,
2.From path – the path of the file placed in a folder like
3.To path – the path of the folder where u want to place the renamed file name like (mostly the same folder as we are going to rename the, or even fine with new path)
"C:\Users\xyz\Documents\UiPath" + Variable name
and this can be done using MOVE FiLE activity…Thats all buddy your file gets renamed.
Hope this would help you
that worked GREAT!! so can I use wild cards somehow to pick up the name I want to rename it too. I have about 500 files to rename
Kindly let know if it works and mark as solution buddy, as it would help others while searching for solution, if you feel it works fine.
How do I create a wildcard that will look at the pdf and extract the text to rename the file and how do i do a For Each activity to do 500 files?
instead of using wildcard being an option its easy to use
system.IO.Directory.GetFiles(pathstring, searchpattern as string) like
This gives us all PDF files in that folder and we can open and get text, rename and move the file to another folder
kindly refer this xaml , would help you resolve that
pdfnewwfilename.xaml (8.0 KB)
It is not working…I did the following and get errors
I added my file path in the parenthesis in the Assign. So it reads
Filepath = system.IO.Directory.GetFiles(“C:\Testing UIPATH.…”,“*.pdf”)
and that is my first error.
Secondly. in the Sequence where you say "Get the text from pdf using get text or read pdf…
I can’t get the text…although it is a native pdf, it only allow me to draw a box around it, and if I uset Read PDF Text, it reads the whole document and not sure how to get the one line that I need for the file name so I can copy it and replace it.
I think I have a LOT more learning to do…
I have worked at this all night and still can’t figure it out. I get this error.
My obstacles are:
I can only get the name of the file to use for the pdfstring if I use a screen scrape but unable to retrieve the copy from clipboard option available there. I was able to generate a data table, but saw no use for that.
Not quite sure if I got the System.IO correct…at the end i added the folder location on my c drive…
Can you provide any further assistance,
Buddy in that image, you have mentioned only folder path not the file path…
Released EF seems like a folder… thats why showing error like unable to fine the file…
This can resolved either of these two steps
- If you know file name mention that file name after that folder like released ef\file name
- If you dont know the file name, yet stored the name of it to a varaible, from directories.getfile,
Put the file name
"…\released ef" + filename variable
Hope this would help buddy…if not no problem…we can sort this buddy…
Hi How we use get text activity to get invoice number only from pdf, not by using any kind of indicate on screen
Welcome to UiPath community Buddy…
Thats a great question to start with
Here is a sample workflow for you buddy…but one thing the pdf that i have is not a native pdf so i used screen scraping to get the invoice from the pdf…
But if the pdf is native, i.e., if you are able to get each wordings as element, then you can use get text instead of screen scrapping
@Palaniyappan thank you, did you use pdf to excel go package?, actually your main file was not working for me, if its pdf to excel, then in result it will return datatable, but as we need variable to be assigned, can someone please share the whole solution
Here i didn’t use pdf related activities buddy, For your reference here is the full solution package for the above xaml files
forum.zip (48.5 KB)
Hope this would help you
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.