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

Code samples for VintaSoft Imaging .NET SDK. Here you can request a code sample.

Moderator: Alex

Post Reply
Alex
Site Admin
Posts: 1577
Joined: Thu Jul 10, 2008 2:21 pm

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

Post by Alex » Thu Sep 13, 2018 9:43 am

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 2017.
  • Create an ASP.NET WebForms application project.
  • Add the references to the Vintasoft assemblies (version 8.7.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 v8.7 can be get from distributive package of SDK.

Post Reply