Pdf extraction


#1

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


#2

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


PDF upload
Read multiple Page PDF with Get Text
#3

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


#4

what error are you getting???

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


#5

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)


#6

Hi @htga99,

Change the data type Arrpdffile to System.String[]

Regards,
Arivu


#7

can you please do the changes and post it back…


#8

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


#9

what would be the filename in Read PDF text?


#10

Hi @htga99,

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

Regards,
Arivu


#11

Hi ,

you can try this sample :slight_smile:

may be it will help for you :slight_smile:

Sample : Sample_artefact.xaml (11.6 KB)


#12

It executed but the text files created are blank.


#13

It worked. Thanks for the help.