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

Question

Question

Convert to TIFF, Rotate and OCR

asked on November 25, 2015 Show version history

I have a third party application that place files on our server in PDF format. These PDF's must be images with a PDF wrapper because when Import Agent brings them into Laserfiche, they are not OCR'd...there is no text stream. The PDFs also need to be rotated counter-clockwise 90 degrees. The vendor could assist with a solution but at a cost.

I require the document text in order for my workflow to search for specific word(s) within the file. Based on the results, the file will be routed to a particular folder.

I haven't used the Laserfiche Distributed Computing Cluster (LDCC) before. Is there a separate license required for RIO customers? I understand that the LDCC can perform some image cleanup, including rotation but this change is not saved. Is there anyway to automatically rotate an image once in the repository?

0 0

Replies

replied on November 25, 2015

As for the Page Rotation, this is something that can be achieved by workflow and can be done on entries in the repository. It would although require the "SDK Script" activity as this is not native to workflow. Not sure why, maybe this is something you could request as a new feature. As for the OCR part, this could also be achieved using the "SDK Script", but not recommended. Longer running processes such as OCR are better suited for dedicated services such as Quick Fields Agent, LDCC, even third party apps using the SDK. If you are interested in some code for the Page Rotation, let me know.

1 0
replied on November 25, 2015

Thanks, Chris and yes, I'm definitely interested in the code for Page Rotation.

0 0
replied on November 25, 2015

Simply add an "SDK Script" activity in your workflow and copy and paste the following code:

namespace WorkflowActivity.Scripting.SDKScript
{
    using System;
    using System.ComponentModel;
    using System.Text;
    using Laserfiche.RepositoryAccess;

    public class Script1 : RAScriptClass91
    {
        protected override void Execute()
        {
            DocumentInfo di = Document.GetDocumentInfo(BoundEntryId,RASession);
            using (PageInfoReader pir = di.GetPageInfos())
            {
                foreach(PageInfo pi in pir)
                {
                    pi.ImageRotation = PageRotation.Counterclockwise;
                    pi.Save();
                }
            }
            di.Save();
        }
    }
}

Before Script:

After Script:

Hopefully that helps!

1 0
replied on December 18, 2015

Did the code work for you?

0 0
replied on December 31, 2015

We haven't purchased the SDK license yet. I have a quote but haven't submitted it for approval. Do I need to purchase a SDK license in order to run this?

0 0
replied on December 31, 2015

I don't think so. Being that it is run in Workflow, the SDK Script activity comes with Workflow.

2 0
replied on December 31, 2015

Chris is correct;  You do not need the SDK to use the SDK Script activity in Workflow.  If you were going to build some type of integration outside of Workflow then you would need to purchase the SDK.  The only additional advantage that the SDK would provide in this case would be documentation and example code snippets. 

1 0
replied on December 31, 2015

To your DCC question - DCC does not require a separate license for Laserfiche Avante or Rio customers. It performs image enhancements solely for the purpose of providing a better OCR result, similar to what the Laserfiche Client supports. That said, DCC still requires an imaged document to perform OCR on, like the Client. Without a text stream, your best option is to use native PDF page generation to generate an image (and OCR it) of the PDF. 

1 0
replied on January 4, 2016 Show version history

As for converting PDF to TIFF, if you search LF Answers for ghostscripts you can find code examples of how to use it, but you will need to have a bit of programming knowledge to dive into it.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.