PDFium Component Docs

SetSelection-metode

Component: TPdfView  ·  Unit: PDFium
Leser eller skriver den programstyrte tekstmarkeringsmodellen til TPdfView uten å kreve museinput fra brukeren

Syntax

function SetSelection(const Ranges: TPdfUserSelectionRanges): Boolean;

Parameters

RangesTPdfUserSelectionRanges. Array of one-based pages, zero-based start indexes, and character counts

Return Value

Boolean. True når hvert område er gyldig og visningsmarkeringen er oppdatert

Description

The selection members expose the same page and character-index model used by viewer selection painting. Calls validate page numbers and character ranges before changing the selection

Programmatic selection works independently of user input options, then repaints the viewer and raises OnSelectionChange through the normal selection pipeline

Remarks

Example

if PdfView1.SelectTextRange(1, 0, 40) then
  Memo1.Lines.Text := PdfView1.SelectedText;

See Also

SelectionRanges, SelectionRectangles, SelectedText, OnSelectionChange