using IronOcr;
using IronPdf;
using System;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1> Iron Software </h1>");
var ocrTesseract = new IronTesseract();
using var ocrInput = new OcrInput();
ocrInput.LoadPdf(pdf.Stream);
var ocrResult = ocrTesseract.Read(ocrInput);
Console.WriteLine(ocrResult.Text);
Imports IronOcr
Imports IronPdf
Imports System
Private renderer As New ChromePdfRenderer()
Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1> Iron Software </h1>")
Private ocrTesseract = New IronTesseract()
Private ocrInput = New OcrInput()
ocrInput.LoadPdf(pdf.Stream)
Dim ocrResult = ocrTesseract.Read(ocrInput)
Console.WriteLine(ocrResult.Text)
Install-Package IronOcr
OCR for PDF Stream
IronOCR also supports Stream.
In this example, IronPDF is used to create a PDF Stream that can later be used for texts recognition by IronOCR.
Please note that IronOCR can only read Stream as an input but do not support exporting Stream as an output file.
Related Docs Links
Ready to get started? Version: 2024.10 just released