cancel
Showing results for 
Search instead for 
Did you mean: 

Rule with condition "match a single term in a pdf ducument"

Stefan79
Champ in-the-making
Champ in-the-making

After I was spending so many hours without findig a solution, I ask you for help:

I have a folder where I upload new searchable pdf-files. Now I want create a folder rule, which runs if "If all criteria are met:" match find the word "test" in (an already searchable) pdf-file.

If I use alfresco-search-bar and search for keyword:test or text:test these files are listet successfully in the results.

I want the rule runs and move the file to folder "moved" if it finds the word "test" in the pdf-file (same like the alfresco-search-bar finds these files correctly)

Thank you for your ideas!

Best regards 

Stefan     

image

2 REPLIES 2

angelborroy
Community Manager Community Manager
Community Manager

The problem with this approach is that searching the content of an already uploaded document is not available. This is an asynchronous process that can take some seconds to complete.

You could try to force the transformation to check if the text is inside the document.

var trans = doc.transformDocument('text/plain', companyhome);
if (trans.content.includes("test"))
{
   // Move or whatever
}

Or to execute the rule from time to time in that folder.

Hyland Developer Evangelist

Stefan79
Champ in-the-making
Champ in-the-making

Thank you very much for your quickly response.

For the moment a changed the system to ecoDMS, because I won't take care filenames and folders in general more.

If I change back to Alfresco I will try your solution.