Studio X - For each file extract PDF Text

Hi all,

I have few PDF files stored in the folder “Input” and would like to extract the text with the function “Extract PDF Text” for each PDF file.

So I use the function “For each File in Folder” and set the PDF file path to “Current File” but it doesn’t work (see the error alert in the image).

If I browse a pdf file directly in the Extract PDF Text function, it works fine.

Need help on how to set the for each file with the extract PDF function.

Thank you !

Hi!

Take a look at the error, it’s telling you that you’re passing a FileInfo (CurrentFile) into the activity, which is expecting a different kind of object.

To “convert” the Fileinfo into something useful for the activitity you should use the current file’s full path, in addition to that it looks like you need to input a “IResource” object.

Try this:
Open the PDF File input in advanced editor:

Input this
LocalResource.FromPath( CurrentFile.FullName)


Save and try to run it :slight_smile:

1 Like

This works perfectly, thanks for your advice!!

1 Like

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