ADC Demo
Demonstrates applying DotImage Advanced Document Cleanup algorithms in a thin-client using our WebImageViewer and WebThumbnailViewer. This is a live demo using ADC and our AJAX enabled WebImageViewer.
[usercontrol] Error loading user control: Could not load file or assembly 'AtalaCMSWebControls' or one of its dependencies. The system cannot find the file specified.This is the C# code-behind used for this demo:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Atalasoft.Imaging.WebControls;
using Atalasoft.Imaging.ImageProcessing;
using Atalasoft.Imaging.ImageProcessing.Document;
public partial class Products_DotImage_adc_ADCDemo_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
this.WebThumbnailViewer1.OpenUrl("Images/DocCleanMultipage.tif");
}
}
[RemoteInvokable]
public void ApplyCommand(string commandName)
{
ImageCommand cmd = null;
switch (commandName)
{
case "HolePunchRemovalCommand":
cmd = new HolePunchRemovalCommand();
break;
case "AdvancedBorderRemovalCommand":
cmd = new AdvancedBorderRemovalCommand();
break;
case "LineRemovalCommand":
cmd = new LineRemovalCommand();
break;
case "AutoInvertTextCommand":
cmd = new AutoInvertTextCommand();
break;
case "SpeckRemovalCommand":
cmd = new SpeckRemovalCommand();
break;
case "DocumentDespeckleCommand":
cmd = new DocumentDespeckleCommand();
break;
case "AutoDeskewCommand":
cmd = new AutoDeskewCommand();
break;
}
this.webViewBefore.ApplyCommand(cmd);
}
}
Here is the client-side javascript required to process images on button clicks without page postbacks:
<script language="javascript" type="text/javascript">
atalaInitClientScript("OnPageLoad()");
var webViewBefore;
function OnPageLoad()
{
webViewBefore = <%= webViewBefore.ClientID %>;
webViewBefore.RemoteInvoked = Invalidate;
}
function Invalidate()
{
webViewBefore.Update();
}
function btnHolePunch_onclick() {
webViewBefore.RemoteInvoke("ApplyCommand", new Array("HolePunchRemovalCommand"));
}
function btnBorderRemoval_onclick() {
webViewBefore.RemoteInvoke("ApplyCommand", new Array("AdvancedBorderRemovalCommand"));
}
function btnLineRemoval_onclick() {
webViewBefore.RemoteInvoke("ApplyCommand", new Array("LineRemovalCommand"));
}
function btnInvertText_onclick() {
webViewBefore.RemoteInvoke("ApplyCommand", new Array("AutoInvertTextCommand"));
}
function btnSpeckRemoval_onclick() {
webViewBefore.RemoteInvoke("ApplyCommand", new Array("SpeckRemovalCommand"));
}
function btnDespeckle_onclick() {
webViewBefore.RemoteInvoke("ApplyCommand", new Array("DocumentDespeckleCommand"));
}
function btnDeskew_onclick() {
webViewBefore.RemoteInvoke("ApplyCommand", new Array("AutoDeskewCommand"));
}
function btn1To1_onclick() {
webViewBefore.setAutoZoom(0);
webViewBefore.setZoom(1);
}
function btnFitToWidth_onclick() {
webViewBefore.setAutoZoom(3);
}
</script>