PDFium Delphi Component Docs

GetTextObjectRenderedBitmap method

Component: TPdf  ·  Unit: PDFium
Rasterise one text object on its own, at a chosen scale

Syntax

function GetTextObjectRenderedBitmap(Index: Integer; Scale: Single): TBitmap;

IndexInteger. Zero-based index of a text page object
ScaleSingle. Rendering scale, where 1.0 renders at the nominal size of the object
ResultTBitmap. A newly created bitmap the caller owns and must free, or nil when the PDFium build does not export the entry point or the object cannot be rendered

Description

Renders just that text object, with its own font, colour, and transform, and nothing else from the page. It is the way to preview a single run, to compare how two fonts render, or to feed a glyph image to a recogniser

The render lock is held for the call, so it is safe against concurrent rendering on the same component

A nil result is not an error condition to abort on: older PDFium builds do not export per-object text rendering, in which case a caller can fall back to cropping a full-page render with the bounds from ObjectBounds

See Also

ObjectBitmap, ObjectBounds, GetTextRenderMode, TextObjectGlyphOutline