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

Question

Question

change entry/document extension

asked on February 25, 2014

Can we change the extension of an Electronic document inside Laserfiche Repository.

We have an .idx while and we want to change it's extension to make it a .txt and then OCR the file and read he matadata (we are trying to achieve this using SDK currently).

 

0 0

Answer

SELECTED ANSWER
replied on February 27, 2014

Here is some code for a 9.1 workflow script using RA.

 

            DocumentInfo docInfo = this.BoundEntryInfo as DocumentInfo;
            if (docInfo != null && docInfo.IsElectronicDocument)
            {                 
                this.DesignTools.Watch("Extension", docInfo.Extension);
                docInfo.Extension = "txt";
                docInfo.Save();
            }



 

2 0
replied on February 9, 2018

Hi Ed, sorry to bump a 4-year old thread but I'm trying to use your solution and it doesn't appear to be working.

 

Our client has all of their files stored as .bin, but in reality some of them are .tif and some of them are .pdf files. All of the .tif files are being imported correctly because I'm using the ImportImages method. However, I can't seem to get the pdfs imported as anything other than .bin.

 

I've tried using this:

 

if (docInfo.IsElectronicDocument)
{
    docInfo.Extension = "pdf";
}
docInfo.Save();
di.Document = docInfo;

and then when I'm importing the document I use

di.ImportEdoc("application/pdf", path + filename);

The documents in LF have the mimetype as application/pdf but the extension is still .bin

Am I doing something wrong?

Thanks

0 0
replied on February 12, 2018

The code Ed provided above changes the extension of an electronic document already in Laserfiche. Yours looks like it then overwrites it with the .bin file. You should either change the .bin extension on disk before import or import first, then change the extension in Laserfiche.

1 0

Replies

replied on March 5, 2014

Thanks alot Ed. smiley

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

Sign in to reply to this post.