Page 1 of 1

ASP.NET WebForms + HTTP handlers: Convert an image to a searchable PDF document.

Posted: Thu Sep 13, 2018 9:43 am
by Alex
In this topic we will show how to convert an image to a searchable PDF document in ASP.NET WebForms application.

For doing our task we need:
  • Open Visual Studio .NET 2019.
  • Create an ASP.NET WebForms application project.
  • Add the references to the Vintasoft assemblies (version 10.x.x.x) and Vintasoft JavaScript files to the project:
    • Vintasoft.Shared.dll
    • Vintasoft.Shared.Web.dll
    • Vintasoft.Imaging.dll
    • Vintasoft.Imaging.DocCleanup.dll
    • Vintasoft.Imaging.DocCleanup.Web.Services.dll
    • Vintasoft.Imaging.DocCleanup.Web.HttpHandlers.dll
    • Vintasoft.Imaging.Ocr.dll
    • Vintasoft.Imaging.Ocr.Tesseract.dll
    • Vintasoft.Imaging.Pdf.dll
    • Vintasoft.Imaging.Pdf.Ocr.dll
    • Vintasoft.Imaging.Web.Services.dll
    • Vintasoft.Imaging.Web.HttpHandlers.dll
    • Scripts\Vintasoft\Vintasoft.Shared.js
    • Scripts\Vintasoft\Vintasoft.Imaging.Svg.js
    You can add the assemblies and JavaScript files manually or automatically. Add the "Vintasoft.Imaging.Web.HttpHandlers", "Vintasoft.Imaging.DocCleanup.Web.HttpHandlers", "Vintasoft.Imaging.Ocr.Tesseract" and "Vintasoft.Imaging.Pdf.Ocr" Nuget packages to the project and the assemblies and JavaScript files will be added automatically.
  • Add Teseract OCR files to the "App_Data" directory.
  • Create a REST service MyVintasoftFileHanlder, which is based on HTTP handler, for manipulating of files on server.
  • Create a REST service OcrHandler, which is based on HTTP handler, for recognizing text in image files stored on server.
  • Create a default ASPX page with JavaScript code, which allows to
    • Upload an image file to the server.
    • Recognize text in uploaded imafe file.
    • See the result PDF document, which stores the text recognition result.

Source codes of ASP.NET WebForms application for VintaSoft Imaging .NET SDK 10 can be get from distributive package of SDK.