Pdf extraction

I have to read and write certain pdf files into notepad. All the pdf’s are in same folder. How to do that?

Hi @htga99,

create string variable → folderlocation
using assign activity
folderlocation=“C:\Documents”
create string array variable → arrpdffile
using Assign Activity
arrpdffile=Directory.GetFiles(folderlocation, "*.pdf")
using for loop loop the arrpdffile
using Read Pdf Text activity read the pdf file and store it in notepad file using write Text File activity

Regards,
Arivu

3 Likes

i am getting error while assigning arrpdffile=Directory.GetFiles(folderlocation, “*.pdf”)

what error are you getting???

string[] arrpdffile=Directory.GetFiles("C:\Users\aanbarasan\Downloads","*.pdf")

i am sending entire file, please check and help me. If there are 2 files, i need 2 txt files.Main.xaml (7.0 KB)

Hi @htga99,

Change the data type Arrpdffile to System.String

Regards,
Arivu

can you please do the changes and post it back…

Hi @htga99,

i can’t upload the xaml file.

just try to change the datatype to string ( select Array of [T] and select string)

and In write Text File activity
FileName->Path.GetFileName(item.ToString)+".txt"

Regards,
Arivu

what would be the filename in Read PDF text?

Hi @htga99,

i said in Write Text file Properties File Name need to change as
Path.GetFileName(item.ToString)+".txt"

Regards,
Arivu

Hi ,

you can try this sample :slight_smile:

may be it will help for you :slight_smile:

Sample : Sample_artefact.xaml (11.6 KB)

It executed but the text files created are blank.

It worked. Thanks for the help.