Skip to content

IPdfPageRasterizer interface

View as Markdown

Namespace: PdfNetStack.Ocr
Assembly: PdfNetStack.Ocr.dll
Package: PdfNetStack.Ocr

Renders a page to pixels for OCR, for pages PdfOcr cannot read from their images. PdfNetStack does not render; an application supplies a renderer, for example one built on PDFium, through Rasterizer.

public interface IPdfPageRasterizer

Render(PdfPage, int, double, CancellationToken)

Section titled “ Render(PdfPage, int, double, CancellationToken)”

Renders a page as it is shown: its crop box, turned clockwise by its /Rotate, on white. Called one page at a time, on the thread running PdfOcr, before the page’s text layer is added, so a renderer may also read the original file at pageIndex.

OcrBitmap? Render(PdfPage page, int pageIndex, double dpi, CancellationToken cancellationToken)

page PdfPage

The page.

pageIndex int

Its zero based index in the document.

dpi double

The resolution to render at, in pixels per inch; already lowered to keep the page within MaxImagePixels.

cancellationToken CancellationToken

Stops the rendering.

OcrBitmap?

The page in 8 bit gray, or null to leave it unread.