Login   Company   1-781-743-2119    

WINGSCAN WHITEPAPER: APPENDING

APPENDING ADDITIONAL SCANS

This Whitepaper is going to be "laser focused" on implementing one specific use case with WingScan: To allow one append the results of a second and subsequent scan to an existing document / previous scan present in the WebDocumentViewer / WebDocumentThumbnailer.

The "out of the box" experience with WingScan is that when you open or scan a document, you are replacing any existing document that is present. So if you have say 2 pages loaded and you begin a scan with page.. you will end up with just the new 1 page scan open and the former document is lost/closed. This then is about "what if I want to add more pages to the existing open document".

This is not a "getting started with WingScan" tutorial. For that, please see Q10462 - INFO: WingScan Whitepaper - Getting Started with Web Scanning.

For other White Papers please see the Whitepaper category on our knowledgebase.

 

TECHNICAL OVERVIEW

In some ways, the append versus open operation is a WebDocumentViewer / WebDocumentThumbnailer operation. We could easily write a KB on "appending a document in WDV" ... in fact, we may do that at a future date. We will be taking advantage of the WDV/WDT viewer.document.insertPages() feature. The difficulty is that in order to insert multiple pages, one must know how many pages one will be inserting. There is no "just insert all the pages in this document".. (An enhancement request for this is officially on file but has not yet been implemented).

An additional complication is that you don't necessarily know in advance before oyu scan how many pages will be part of the scan. If you are using blank page detection/removal (VRS License required) then the number of pages may not match the number of pages you have inserted.

In order to solve this problem, what we will be doing is implementing a simple count incrementor during the imageAcquired event so that we track in real time how many pages have been uploaded. This way, we know the moment the scan has finished how many pages need to be inserted. This saves us the ugly step of having to go back to the server side and implement some form of "count number of pages in this file" (perhaps fodder for a WDV whitepaper in the future).

We will be starting with the final result project from Q10462 - INFO: WingScan Whitepaper - Getting Started with Web Scanning. You can download the sources for the starter project here: WingScan_withViewer_v11.1.0.1.zip.

We will then modify it to add handlers for image acquired, we will add a new function to decide if we are appending or adding and add buttons to trigger that functionality, and finally adjusting the uploadCompleted handler to perform the append (or open as directed).  

DOCUMENT STANDARDS AND ASSUMPTIONS

The technical portions of this document assume that you are a developer with access to MS Visual Studio 2013 or later. We will be providing examples in C#. Our SDK works with VB.NET as well, but for the sake of simplicity any .NET code will be provided in C# You can use a converter tool such as Telerik Code converter to convert examples to VB.NET

This document and our SDK assume that you're a developer familiar with basic use of Visual Studio, IIS Express or IIS, and general web application development practices. The samples will be using an HTML 5 approach in a non-MVC application targeting .NET framework 4.5.2 in a 64 bit application.

Please note that DotImage 11.0 and newer supports .NET 3.5 (using our 3.5 dlls) or .NET 4.5.2 or greater (using our 4.5.2 dlls) .. support is not possible for .NET 4.0, 4.5 or 4.5.1 using DotImage 11.0 or higher. If you have an existing app you want to add DotImage to that targets an unsupported .NET framework, you will need to update it.

Also note that this document covers a standard ASP.NET web app, not ASP.NET Core. We do have support for ASP.NET core targeting .NET framework (not pure .NET Core), but that is beyond the scope of this document. The fundamental concepts of this document apply whether you are going to use ASP.NET or ASP.NET Core the client-side code is the same - the difference is in the handler (used for ASP.NET) versus the startup middleware (used by ASP.NET Core).

A brief set of instructions for downloading our SDK and activating a license will be given, but the rest of the document assumes you've installed the latest DotImage SDK (currently 11.1.0.1 as of January 2019)

Examples herein will use IIS Express (built in web server for Visual Studio) set to run in x64 mode

We do provide NuGet packages for our components, but this example will assume you've installed and activated our SDK locally.

If you're a licensed developer, or are actively evaluating our SDK and run into problems/questions, you are welcome to contact support. You can make a support case in writing in our support portal

You may also call in to support during our normal business hours
Support Hours: M - F from 8AM - 5PM EDT (New York Time)
Call us: 1-781-743-2119

 

STANDARD TROUBLESHOOTING

Web applications with WingScan have a lot of "moving parts" and troubleshooting can seem a daunting task.

There are two tools (one ours, one a free third party tool) that can greatly enhance troubleshooting and assist you in reporting issues to support

If you are having issues with WingScan

Please download and run the diagnostic logging tool

Use it to collect a log while you reproduce the issue.

These diagnostic logs will often show the root cause of an issue. Although they may be a bit daunting to look at at first, rest-assured, they're a valuable diagnostic tool. So, if you're contacting support about a WingScan issue, please take a moment to collect this log then save it to a text file, then zip up the log file and attach it to your support case

In addition to the WingScan log, problems related to the client-side web components are best diagnosed by looking at a log of the network traffic. Most commonly a faulting application will clearly show a 500 internal server error being thrown and the full response body of that error will offer a great deal of insight into the root cause (licensing issues, and errors in the WebCaptureHandler and WebDocumentRequestHandler will most often show up in the 500 error response body)

We recommend Fiddler if you need to collect a log and report it to support.

Please download, install, and run Fiddler web logging

Use it to collect a log while you reproduce the issue, then save the log as a native .saz file and and attach it to your support case as a file attachment/ (please do not save as CSV or text log. The native SAZ file gives us much better access to the tools we need to help diagnose your issue)

PLEASE NOTE: you need to capture a session while NOT using SSL/HTTPS. Fiddler logs cannot see into HTTPS without enabling a special certificate which we do not recommend.. if your capture is of an HTTPS session we will not get useful diagnostic information from the log

 

INSTALLATION AND LICENSING

If you have not done so already, please download the latest version of Atalasoft DotImage SDK

NOTE: The current version is 11.1.0.1 as of the creation of this document (January 2019) updates of the SDK happen with regularity. We work hard not to make breaking changes so this guide should be compatible with future releases. We will update the specific technical details as needed as changes arise

If you have not done so, please create an account with Atalasoft so that you can download and activate our SDK

NOTE for IIS users: The licensing above should be sufficient if you're using the built in web server in Visual Studio (IIS Express) but if you are using a local copy of IIS, then the IIS process does not run as your user name so it will not pick up your licenses. You'll need to take the extra step of copying your licenses into the application bin directory.

Assuming you have an app named WingScanTestApp hosted in IIS under:
c:\inetpub\wwwroot\WingScan_withViewer\

Then you'd copy your licenses from:
C:\users\YOUR_USERNAME\AppData\Local\Atalasoft\DotImage 11.1\
to
c:\inetpub\wwwroot\WingScan_withViewer\bin\

 

MODIFYING THE SAMPLE APP

As mentioned above, we will be basing this project on the completed getting started with WingScan project from another whitepaper.

SAMPLE APP DOWNLOADS

It is our hope that you've been following along with the tutorial and have successfully built your solution. However, if you've run into issues or if you want a working reference app, we've implemented both the WingScan_noViewer and WingScan_withViewer for you to download and run if needed. They also make great test harnesses for any experimental WingScan code you want to try out... letting you start from a known-working application.

CONCLUSION

It is possible to seriously customize the viewer and the saving, and it is possible to perform many other useful tasks with WingScan and with WDV/WDT. This paper focused specifically on how to enable appending to the existing current document in the WebDocumentViewer / WebDocumentThumbnailer while scanning. Please see our growing list of whitepapers for more use cases / examples / tutorials.

v002 - 2019/01/29 - TD