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

Question

Question

Read a File from Laserfiche repository

asked on October 13, 2014 Show version history

How do u read a file from laserfiche repository inside the script editor in workflow? Please provide a sample code. I tried using File.Open Read but it it looking for the file in the worklow server.

 

Thanks

Priya

0 0

Replies

replied on October 13, 2014

This question has some sample code that might help you.

0 0
replied on November 7, 2014

I get an error "LFDocument" is not defined,  'LFElectFileReadStream' is not defined. What libraries should I reference and should i have to install anything to reference these? Where in the code I specify the repository name that it should look into?

 

Priya

 

0 0
replied on November 7, 2014

Can you post your code, please?

If this is still in Workflow, the SDK script activity takes care of the connection to the repository for you (based on the connection profile specified in the Workflow definition).

1 0
replied on November 7, 2014

Thanks. Below is the code:

 

            'Write your code here.
'                Dim doc as LFDocument=me.Entry
'                Dim Datastream as LFElectFileReadStream =Doc.ElectFile.ReadStream
'                Datastream.open()
'                Dim content as Byte() =Datastream.ReadData(Datastream.DataLength)
'                Dim mem as new MemoryStream(content)
'                Datastream.Close()
                SetTokenValue("test",content)

0 0
replied on November 10, 2014

Do you have any update on this please? Thanks

0 0
replied on November 10, 2014

This has been mentioned in your previous posts, if you could explain what you are trying to do, we could answer these questions faster and more accurately.

 

It sounds like you are trying to use LFSO code in Workflow 9.1. LFSO was used in Workflow 9.0 and lower. Workflow 9.1 and higher defaults to using RepositoryAccess instead of LFSO for connecting to Laserfiche. While it is possible to add a reference to LFSO in Workflow 9.1, using RepositoryAccess is more efficient because it is a .Net assembly.

 

I'm going to guess that you're trying to get the electronic document size.

 

Repository Access:

                dim docInfo as DocumentInfo =me.BoundEntryInfo
                SetTokenValue("Size",docInfo.ElecDocumentSize)

LFSO:

            dim doc as LFDocument = me.Entry
            SetToken("size",doc.ElectFileSize)

 

1 0
replied on November 10, 2014

Yes, in the sample code, I am trying to read pdf file and print its size. My ultimate goal is to read the pdf file into a memory stream and send it for signature to Docusign. Thanks.

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

Sign in to reply to this post.