Using TwainSession.SaveTemplate to Save a Subset of Settings

Saving the settings of your TWAIN device is a very important feature which is fully supported by LEADTOOLS. For the end-user, it allows them to load and save different scanning profiles and options they use on a regular basis such as “high resolution color photo”, “medium quality black and white document”, or “auto-cropped receipt”. One caveat to this feature is that it saves all of the settings, which comes with a few downsides:

  1. Large template files
  2. Longer execution time
  3. Most importantly…That template file will only work on one scanner

To alleviate these problems, LEADTOOLS now has a new overload for its TwainSession.SaveTemplateFile function which allows you to save a subset of settings rather than the entire collection. As long as you are saving core, mandatory settings that are supported by all TWAIN scanners, you can use these templates regardless of the hardware device being used!


int[] nCapabilitiesToSave = { (int)TwainCapabilityType.ImagePixelType, 
                              (int)TwainCapabilityType.ImageXResolution, 
                              (int)TwainCapabilityType.ImageYResolution };

_twSession.SaveTemplateFile(saveDlg.FileName, 
                            nCapabilitiesToSave, 
                            SaveCapabilityOptions.Current);

For a complete example, check out the original forum post.

Posted in Document Imaging, General Imaging | Tagged , , , , , | Leave a comment

Customer Success Story: Power Class 360

In its nearly 25 year history, the number of customers and people that have used LEADTOOLS is near impossible to count. Sometimes our product makes a profound impact on a customer and they want the world to know. Our latest customer success story comes from Power Class 360, a non-profit organization dedicated to education.

As a non-profit organization looking to help shape our country’s young ones for the better, we got behind their cause and donated a copy of our LEADTOOLS Document Imaging SDK. With LEADTOOLS, Power Class 360 was able to successfully modernize the classroom with a digital transparency and document management system complete with Annotations, HTML5 and more.

Click here to read the full story!

If you have a success story of your own that you’d like to share, we’d love to hear from you! Please send an email to marketing@leadtools.com to set up an interview.

Posted in News | Tagged , , , , | Leave a comment

Simplified ASP.NET Web Forms OCR Demo

HTML5 is certainly the way of the future, but as many web developers know, adoption can be slow. In many cases, older browsers such as IE8 is still in use enterprise-wide and a lightweight, feature packed solution is still required. LEADTOOLS pioneered lightweight ASP.NET Web Forms imaging years ago and is still a popular choice. Though not as flashy and responsive as HTML5, the heavy-lifting jobs such as Optical Character Recognition (OCR) are still done on the server side.

In the following example, you’ll see how to add OCR functionality and image display into your ASP.NET Web Forms application.

ASPX


<%@ Register Assembly="Leadtools.Web" Namespace="Leadtools.Web.Controls" TagPrefix="ltwf" %>
...
<ltwf:WebImageViewer ID="WebImageViewer1" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Recognize" OnClick="Button1_Click" />
<asp:TextBox ID="RecText" runat="server" TextMode="MultiLine"></asp:TextBox>

ASPX Code Behind


IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Professional, true);
ocrEngine.Startup(null, null, null, null);
using (Leadtools.Forms.Ocr.IOcrDocument document = ocrEngine.DocumentManager.CreateDocument())
{
   document.Pages.AddPage(strFileName, null);
   RecText.Text = document.Pages[0].RecognizeText(null);
}
ocrEngine.Shutdown();

For a complete example, check out the original forum post.

Posted in OCR | Tagged , , , , , , , , | Leave a comment

New White Paper: DICOM Media Creation Management Solutions with LEADTOOLS

If you’ve ever had an MRI, CT or large number of X-rays during a medical visit, chances are you hoped to get a copy of your images to show your family, friends or another doctor. Not too many years ago you might get lucky and take home a huge film sheet to hold up against a bright light. Thankfully, today’s digital world has made it more practical by storing your study on a CD or DVD with an embedded viewing application. If this service is available, some hospitals may hand them out as common practice while others may only provide it upon request.

Unfortunately this capability is not as common as you would think. Unbeknownst to many in the medical imaging sector are the numerous benefits that go beyond the basic take-home copy for patients. Check out our latest white paper which helps explain what DICOM Media Creation Management is and does, and how LEADTOOLS can help you along the way.

DICOM Media Creation Management Solutions with LEADTOOLS
It goes without saying that the DICOM specifications are massive and can be difficult to implement on your own. There are a wide variety of products for software developers, end-users and integrators that make DICOM and PACS more accessible and user-friendly. However, even among SDKs there are many features within the DICOM specifications that get overlooked or cast aside. One such feature is DICOM Media Creation Management. This white paper will demonstrate how to use the comprehensive DICOM and PACS functionality in LEADTOOLS to easily add DICOM Media Creation Management to your application.

We have also published this white paper on The CodeProject if you would like to read it in an online format.

Posted in Medical Imaging | Tagged , , , , , , , , , | Leave a comment

Cleaning Up Color Images with LEADTOOLS Document Imaging

One of the most foundational features in document imaging is image cleanup (also called preprocessing). When paper documents are scanned to digital form there are almost always imperfections. The paper can be at an angle, hole punches leave large black dots, folded paper introduces lines, and at the very least dust speckles litter small, dark dots throughout the image. All of these can have an adverse trickle-down effect on many other algorithms such as OCR, Forms, Barcode, Compression and more.

There is one caveat with most document imaging libraries: the document images must be black and white. While technically true for LEADTOOLS as well, it’s not a limitation whatsoever. Each of the LEADTOOLS document cleanup functions return information on what it has done. For example, you can get the deskew angle, rectangle to crop, or region to fill and then apply those same operations on a color image:


// First make a copy of the image
using (RasterImage image = viewer.Image.Clone())
{
   // If the image is not 1bpp black and white, convert it
   if (image.BitsPerPixel != 1)
   {
      AutoBinarizeCommand autoBin = new AutoBinarizeCommand();
      autoBin.Flags = AutoBinarizeCommandFlags.DontUsePreProcessing;
      autoBin.Run(image);
      ColorResolutionCommand colorRes = new ColorResolutionCommand();
      colorRes.BitsPerPixel = 1;
      colorRes.Run(image);
   }

   // Process the 1bpp copy
   DeskewCommand deskewCom = new DeskewCommand();
   deskewCom.Flags = DeskewCommandFlags.ReturnAngleOnly;
   deskewCom.Run(image);

   // Apply the same transformation on the original color image using 
   // the data from the 1bpp cleanup function
   RotateCommand rotateCom = new RotateCommand();
   rotateCom.Flags = RotateCommandFlags.Resample;
   rotateCom.FillColor = viewer.Image.GetPixelColor(0, 0);
   rotateCom.Angle = deskewCom.Angle;
   rotateCom.Run(viewer.Image);
}

To see more and play with it on your own images, you can download the full example from the original forum post.

Posted in Document Imaging | Tagged , , , , , , , , , , , , | Leave a comment