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: 2300
Joined: Thu Jul 10, 2008 2:21 pm

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

Post 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 2022.
  • Create an ASP.NET WebForms application project.
  • Add the references to the Vintasoft assemblies (version 12.x.x.x) and Vintasoft JavaScript files to the project:
    • Vintasoft.Shared.dll
    • Vintasoft.Shared.Web.dll
    • Vintasoft.Imaging.dll
    • Vintasoft.Imaging.Gdi.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.Html5.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 12 can be get from distributive package of SDK.
Post Reply