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

Question

Question

Set Scanning Default Properties via SDK

SDK
asked on September 3, 2015 Show version history

Is it possible to set the Scanning Default Properties via SDK, like the Template, Pages per document, and some of the fields pertaining to the template. If so can you point me where to look or small sample of code?

We currently have program that creates an image object in laserfiche and updates the metadata, then launches the laserfiche scan program that will then scan the image into the object that was created. The problem we face is, the user will sometimes launch the Scan program  but not finish/store the image, so we have the image object created with no image file. 

What we want to do now is change the program to launch the scan program, set the template, set the folder where they will be scan to, and some of the fields.

Below is the  code we are using.

 - Thank you

                using (ClientManager lfclient = new ClientManager())

                {

                    LaunchOptions myLaunchOptions = new LaunchOptions();

                    myLaunchOptions.HiddenWindow = false;

                    myLaunchOptions.ShowSplashScreen = false;

                    myLaunchOptions.ServerName = strServerName;

                    myLaunchOptions.RepositoryName = strRepositoryName;

                    myLaunchOptions.UserName = strUserName;

                    myLaunchOptions.Password = strPassword;

 

                    ScanOptions myScanOption = new ScanOptions();

                    myScanOption.ScanMode = ScanMode.Standard;

                    myScanOption.ConnectionString = strLaserficheConnection;

                    myScanOption.IsDocument = true;

                    myScanOption.EntryId = docId;

                    myScanOption.InsertPagesAt = (int)InsertAt.End;

                    myScanOption.WaitForExit = true;

                    myScanOption.CloseAfterStoring = true;

                    lfclient.LaunchScanning(myScanOption);

 

                    globalClient.LaunchClient(myLaunchOptions);

 

                    ProcessStartInfo startInfo = new ProcessStartInfo();

                    startInfo = new ProcessStartInfo();

                    startInfo.WindowStyle = ProcessWindowStyle.Hidden;

                    startInfo.CreateNoWindow = true;

 

                    startInfo.FileName = "cmd";

                    startInfo.Arguments = @"/C c: && cd \Program Files (x86)\Laserfiche\Client\Scanning\ && LFScan -b -d " + docId.ToString();

                    process1 = Process.Start(startInfo);

                    Thread.Sleep(1500);

                    process1.Kill();

                }

 

 

0 0

Replies

replied on September 3, 2015

I'm not quite understanding the situation, it sounds like your program is creating the document in Laserfiche and setting metadata (including the template) before launching scanning. Can you be more specific about how your current integration works?

0 0
replied on September 3, 2015

That is what is happening; however we want to move away from that, and just set/update the Default properties of the scan program when launched.

0 0
replied on September 4, 2015

Scanning will launch its default settings. It's not possible to pass in different values when launched from the LF Client.

0 0
replied on June 27, 2016 Show version history

Hi Russell,

how did you solve your situation ? Before coming across your question, I ended up doing exactly what you did originally: create a new LF doc, assign fields/template/other meta data, then launch Scanning.

Your question above - if I understand correctly - tried to solve the "left-over empty doc if nothing was scanned" by not creating the initial empty doc, but by passing the desired meta data directly to the Scan process (which presumably would attach it to the doc if something was scanned, or else - ie no scan - don't create any doc at all).

My solution right now is going to be just to check # of pages of the doc, and if it's still zero after the scan, then I'll delete the empty LF doc. But it's not a very elegant one.

So I wondered how your story ended, if it's something you wouldn't mind sharing ? thanks

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

Sign in to reply to this post.