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

Question

Question

ScanOptions.InsertPagesAt = InsertAt.Ask

asked on August 24, 2015

Using the following code, the InsertPagesAt = InsertAt.Ask doesn't seem  to ever cause LFScan.exe to prompt the user where to insert the scanned pages at. Have I set something incorrectly or am I not expecting the correct behavior? Thank you.

      Using lfc As New ClientManager()
        Dim sOptions As New ScanOptions()

        sOptions.ServerName = _settings.LFServer
        sOptions.RepositoryName = _settings.LFRepository
        If Not _settings.LFWindowsAuthentication Then
          sOptions.UserName = _settings.LFUser
          sOptions.Password = _settings.LFPassword
        End If

        sOptions.EntryId = CInt(docId)
        sOptions.InsertPagesAt = InsertAt.Ask
        sOptions.ScanMode = ScanMode.Basic
        sOptions.CloseAfterStoring = True
        sOptions.WaitForExit = True

        lfc.LaunchScanning(sOptions)
        RefreshView()
      End Using

 

0 0

Answer

SELECTED ANSWER
replied on August 24, 2015

You need to launch scanning through the DocumentViewer class to show the page picker. This is a bug, we will look into fixing it in a future version.  To get the page picker, launch the client using ClientManager.LaunchClient (you can use HiddenWindow=true to not display the main window), then open the doc viewer and launch scanning like this:

LaunchOptions launchoptions = new LaunchOptions();
launchoptions.RepositoryName = repository;
launchoptions.ServerName = servername;
launchoptions.UserName = username;
launchoptions.Password = password;
launchoptions.HiddenWindow = true; // Don't show the main window

// Launch the client
using (ClientInstance client = lfclient.LaunchClient(launchoptions))
{
    MainWindow mainwindow = null;

    // Find the main window.
    IEnumerable<ClientWindow> windows = client.GetAllClientWindows();
    foreach (ClientWindow window in windows)
    {
        if (window.GetWindowType() == ClientWindowType.Main)
        {
            mainwindow = (MainWindow)window;
            break;
        }
    }

    OpenOptions openOptions = new OpenOptions();
    openOptions.OpenStyle = DocumentOpenType.DocumentViewer;
    mainwindow.OpenDocumentById(documentid, openOptions);
    DocumentViewer docViewer = null;
    windows = client.GetAllClientWindows();
    foreach (ClientWindow window in windows)
    {
        if (window.GetWindowType() == ClientWindowType.DocumentViewer)
        {
            if (((DocumentViewer)window).GetDocumentId() == documentid)
            {
                // Found the new doc viewer window
                docViewer = (DocumentViewer)window;
                break;
            }
        }
    }

    // Launch Scanning
    if (docViewer != null)
        docViewer.LaunchScanningFromClient(scanoptions);
}

 

 

1 0
replied on August 25, 2015

Sounds good, thank you.

0 0

Replies

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

Sign in to reply to this post.