You are viewing limited content. For full access, please sign in.

Discussion

Discussion

Feature Request: Add Redaction by Location in Workflow

posted on March 20, 2021

I'm not sure if maybe I'm just missing something, but it looks like the only option for the Workflow Add Text Annotation activity is Pattern Matching, but I'd love the option to just place a redaction in an exact location.

We have some types of documents where we always know the exact location of the text we need redacted, so a position option similar to what you can do with text boxes and stamps would be great.

I know we can set location-based redaction in QF, but real-time redaction via workflow would be ideal for our primary use case. In the meantime I can use a custom script, but this would be a useful workflow activity.

1 0
replied on March 22, 2021

You can use SDK Script:

 protected override void Execute()
        {
            // Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session

            DocumentInfo docInfo  = (DocumentInfo)BoundEntryInfo;
            PageInfo pInfo = docInfo.GetPageInfo(1);
            RedactionAnnotation redaction = new RedactionAnnotation(docInfo.Id, 1, docInfo.Session);
            Laserfiche.RepositoryAccess.Common.LfRectangle rect = new Laserfiche.RepositoryAccess.Common.LfRectangle();
            List<Laserfiche.RepositoryAccess.Common.LfRectangle> rects = new List<Laserfiche.RepositoryAccess.Common.LfRectangle>();
            rect.X = 100;
            rect.Y = 200;
            rect.Height = 1000;
            rect.Width = 2000;
            rects.Add(rect);
            redaction.ImageRectangles = rects;
            redaction.Color = Laserfiche.RepositoryAccess.Common.LfColor.BLACK;
            pInfo.AddAnnotation(redaction);
            pInfo.Save();
        }

Before.jpg
After.jpg
Before.jpg (25.63 KB)
After.jpg (34.47 KB)
0 0
replied on March 22, 2021

Yea, I've done it with scripts. I just meant it would be nice to have a drag and drop option to keep scripts to a minimum.

Something interesting to note; it doesn't seem to be necessary to call .Save() depending on what you're doing.

            var success = false;

            try {
                // set redaction location
                List<LfRectangle> coords = new List<LfRectangle>();
                LfRectangle rectangle = new LfRectangle(780, 450, 1640, 160);
                coords.Add(rectangle);

                // get page
                DocumentInfo docInfo = (DocumentInfo)this.BoundEntryInfo;
                PageInfo page = docInfo.GetPageInfo(1);

                // apply redaction
                RedactionAnnotation redaction = new RedactionAnnotation();
                redaction.Color = LfColor.WHITE;
                redaction.ImageRectangles = coords;
                page.AddAnnotation(redaction);

                // set results
                success = true;
            }
            finally {
                SetTokenValue("Redacted",success);
            }
1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.