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

Question

Question

Problem Export Document in Workflow

asked on February 25, 2019 Show version history

Hi, I try to create a script in Laserfiche Workflow  who export documents of the Laserfiche Repository in my Windows Folder. The code that I write is this:

int documentid = some default ID to test ;
            using (ClientManager lfclient = new ClientManager())
            {
                ExportOptions exportoptions = new ExportOptions();
                Laserfiche.ClientAutomation.PageSet pages = new Laserfiche.ClientAutomation.PageSet();
                exportoptions.PageNumbers = pages;
                exportoptions.DoNotPrompt = true;
                exportoptions.DestinationPath = exportPath;
                exportoptions.ImageFormat = ImageType.Pdf;
                exportoptions.DocumentPart = ExportType.Images;




                LaunchOptions launchOptions = new LaunchOptions();
                launchOptions.ServerName = serverName;
                launchOptions.RepositoryName = Repository Name;
                launchOptions.UserName = Username;
                launchOptions.Password = Password;

                ClientInstance singleLf;
                MainWindow mainwindow = null;
                singleLf = lfclient.LogIn(launchOptions, out mainwindow);
                mainwindow.ExportById(documentid, exportoptions);
             }

I use Laserfiche.ClientAutomation version 10.2 for exporting documents. When I run only the script he run without errors and export the document. When I run the workflow with the script this warning appear and the export doesn't work.

What should I do to escape of this warning/error?

0 0

Answer

SELECTED ANSWER
replied on February 25, 2019 Show version history

Because Workflow runs as a service without a Desktop session, you cannot use the Client Automation DLL.  You can add a reference to the DocumentServices and then use the Laserfiche DocumentExporter.

See Workflow to Export Document to Windows Folder

2 0
replied on February 26, 2019

Thanks. 

0 0

Replies

replied on February 25, 2019

Try and make sure your Import is looking at the right assembly.  I believe the dll should be located in a path similar to this:

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\ClientAutomation\v4.0_10.3.0.0__607dd73ee2bd1c00

Verify that exists and your script is pointing to it from the library.

0 0
replied on February 25, 2019

The path that you specified above does not exist.

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

Sign in to reply to this post.