Skip to main content

TdxPDFViewerHighlights.Add(TdxPDFPageTextRanges,TdxAlphaColor,TdxAlphaColor) Method

Highlights a text range with the specified color within the loaded PDF Document.

Declaration

procedure Add(const ARanges: TdxPDFPageTextRanges; ABackColor: TdxAlphaColor; AFrameColor: TdxAlphaColor); overload;

Parameters

Name Type
ARanges TdxPDFPageTextRanges
ABackColor TdxAlphaColor
AFrameColor TdxAlphaColor

Remarks

Call this procedure to highlight a PDF document text range passed as the ARange parameter. Pass the required background and outline highlight colors as the ABackColor and AFrameColor parameters, respectively.

If you need to paint text highlights in Look and Feel-dependent colors, add the dxCoreGraphics unit to the uses clause and pass the dxacDefault constant as the ABackColor and AFrameColor parameters.

Text highlights created by the Add procedure calls do not become visible automatically. To show or hide all the highlights within the document, use the Visible property.

The second overloaded variant accepts an array of text ranges as the ARanges parameter, allowing you to highlight multiple ranges simultaneously.

To remove all displayed highlights you can call the Clear procedure.

Note

Since the highlight rectangles are painted on top of the document text, normally, the alpha value of the color passed as the ABackColor parameter is much less than 255. Otherwise, the highlight effect created by the Add procedure overlaps the highlighted text and renders it unreadable.

See Also