Continuous Multipage Scrolling in HTML5

Most image viewing applications and controls are designed for viewing a single image at a time. However some images and documents, such as TIFF and PDF, have multiple pages. Since these documents are typically full of text, it is very natural to keep reading on to the next page without the need to press a button to load the next page. We have received several requests for this feature and one of our developer support agents has created an demo showing how to implement continuous multipage scrolling with our HTML5 viewer and RESTful Web Services.

The basic idea works similarly to an image slider or carousel you might see on a homepage. There is an outer container which, when scrolled to a specified location, will asynchronously create an additional HTML5 Viewer for the next page and allow you to keep scrolling until you have reached the end of the document. Below is the JavaScript snippet which modifies the DOM with jQuery and calls the LEADTOOLS Raster Web service to retrieve the image.


window.addEventListener("load", function()	{
   $("#loadFileButton").bind("click",function(sender,e)	{
      
      documentUri = $("#fileURLTextBox").val();					
      pagesLoaded = 1;
      numPages = 0;									
      $("#outerContainer").empty();
      
      LoadInfo(documentUri);			   			   
      LoadAndAddPage(documentUri,pagesLoaded++);				
   
      $("#outerContainer").scroll(function(e)	{
         var scrollPos = $(this).scrollTop();
         
         if(scrollPos > DIV_WIDTH * (pagesLoaded-1) - DIV_WIDTH && pagesLoaded <= numPages)	
            LoadAndAddPage(documentUri,pagesLoaded++);
      });
      
   });

}, false);

function LoadAndAddPage(filePath,pageNum)	{
   var URLPath = serviceUrl + "/Raster.svc/Load?uri=" + filePath + "&page=" + pageNum;
   
   var pageDiv = document.createElement("div");
   $(pageDiv).attr("id","page"+pagesLoaded);
   $(pageDiv).addClass("imageViewer");
   $("#outerContainer").append(pageDiv);
   
   var pageOptions = new Lt.Controls.ImageViewerCreateOptions("page"+pagesLoaded,"page"+pagesLoaded);
   var newViewer = new Lt.Controls.ImageViewer(pageOptions);

   newViewer.add_imageChanged( function(sender,e)	{
      newViewer.set_sizeMode(Leadtools.Controls.ImageViewerSizeMode.fitWidth);		
      $(pageDiv).height(DIV_WIDTH/pageWidth * pageHeight);
   });

   newViewer.set_imageUrl(URLPath);			
}

To download the full example, check out the original forum post.

Keep the feature and example requests coming! Our technical support agents are well trained programmers and absolutely love to take on any challenges you come up with and help you get a jump start on your application.

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

Updates to the h.264 Encoder and Multimedia SDK

h264 Codec

LEAD Technologies has added two popular feature requests which will be available to all Version 18 customers free of charge. The h.264 Encoder now supports Intel Quick Sync Video hardware acceleration. On supported processors, the video encoding time is typically cut in half, with an almost 60% reduction in CPU utilization.

For processors that do not support Intel Quick Sync video, customers can also take advantage of new High Profile capabilities (in addition to the already supported Main and Baseline) for improved video encoding onto Blu-Ray media.

Additional Multimedia SDK Enhancements

In addition to the new h.264 features, this Multimedia update includes several new features to the Multimedia SDK which improve its flexibility and customization. Programmers may now implement their own video renderer — for example, an OpenGL based solution — along with a demo to help customers get started on their custom rendering projects. The MPEG-2 Transport UDP Source Filter was enhanced with new options to monitor the receipt of data for optimal synchronized playback when using multiple video sources.

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

New White Paper: Automatically Classify Scanned Documents using LEADTOOLS Forms Recognition

Today we have released a new white paper which explains in great detail how to use our Forms Recognition and Processing to automatically classify a folder of documents. It describes a common problem where time and energy is lost through the organization of scanned or paperless bank statements, invoices and other documents, and how easy it is to solve it with LEADTOOLS. Our imaging SDKs are used in scenarios like this day in and day out, helping people and businesses be more efficient, organized and utilize their time on more enjoyable or productive tasks. It also offers several suggestions on how to enhance the basic application provided to achieve even greater things like cloud integration and large scale operations!

Automatically Classify Scanned Documents using LEADTOOLS Forms Recognition
Document imaging is certainly saving trees and physical storage space, but in some situations it fails to save much time or hassle. Opting in to paperless statements or manually scanning paper documents yourself is a great way to archive all of your bills, invoices, financial statements and the like. However, it still requires a fair amount of time and energy to thoughtfully organize the documents in your digital filing cabinet. Imagine being able to drop all of your scanned documents into a single folder and have all the work of moving and renaming the files in a logical, consistent manner done automatically. LEADTOOLS Forms Recognition and Processing fits the bill perfectly with its high level, flexible and powerful imaging libraries.

This white paper is also published as a Code Project article from which you can download the full sample project.

Posted in Forms Recognition and Processing | Tagged , , , , , , , , , , , | Leave a comment

Using LEADTOOLS CDLL Functions in Android

Android NDK for C/C++

After a successful and productive exhibit at AnDevCon, we have had a rewarding time talking to our many customers using the LEADTOOLS Android SDK. It is growing rapidly in popularity, and developers are putting it to use in many exciting ways. Fairly soon, LEADTOOLS should literally be in the palms of millions of hands around the world.

While the LEADTOOLS Android Java class library provides powerful imaging technology, some customers require native only apps or are simply more skilled and comfortable with C/C++ development. Recently, we have had several customers ask if it was possible to use LEADTOOLS C/C++ to create native Android apps (using the Android NDK) instead of using the Java class library. Never backing down from a challenge, our Developer Support agents created a sample project that shows off this functionality. Here’s a snippet of the C++ code that exposes L_IntensityDetectBitmap through JNI:


JavaVM* g_vm;
extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved)
{
   g_vm = vm;
   return JNI_VERSION_1_2;
}

/******************************************************************************/
/* Exported Functions                                                         */
/******************************************************************************/

/******************************************************************************/
/* L_IntensityDetectBitmap                                                    */
/******************************************************************************/
extern "C" JNIEXPORT int JNICALL Java_cpp_leadtools_sample_ltimageclr_IntensityDetectBitmap(
   JNIEnv * env, jobject obj, int bitmap, int uLow, int uHigh, int crInColor, int crOutColor, int uChannel, int uFlags)
{
   return L_IntensityDetectBitmap((pBITMAPHANDLE)bitmap, uLow, uHigh, (COLORREF)crInColor, (COLORREF)crOutColor, uChannel, uFlags);
}

To download the full example, check out the original forum post.

All of our technical support agents are well trained programmers and love the opportunity to create new and challenging sample projects, so keep your requests and ideas coming. LEADTOOLS is the most robust and time-tested imaging SDK in the world and we will do everything possible to help you make it work with whatever ideas you come up with!

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

Online Documentation Enhancements

Screenshot of new .NET webhelp

Some of you may have noticed already, but our web-based .NET documentation has gone through a major renovation and upgrade. Our documentation team has been collecting feedback and requests for a while and had a chance to start implementing the enhancements after Version 18 was completed. Some of it is cosmetic, but there are some pretty neat features and user interface updates that have greatly enhanced the webhelp. Here are a few of the major features added or enhanced in the new webhelp:

  • New toolbar and TOC (Table of Contents) with larger, modern icons
  • Visually pleasing keyword indexes
  • Embedded chat page to facilitate communication with Support
  • New search options
  • Smarter and more efficient TOC
    • Dynamically generated TOC increases speed and navigability
    • Persistent state remembers which branches you have opened
    • Sync button highlights where your current article is located in the TOC
  • Platform Support Icons
  • Always visible direct link to the currently displayed article for easy sharing and bookmarking
  • New option to email link to the current page
  • Ability to show and hide the webframe
  • New icons that show which platforms are supported by a function, property or event

We hope you find the documentation more thorough and easier to navigate, giving you more time where you need it most: in your code. As always, if there are any more features you would like to see, let us know!

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