PDFium Component Docs

เมธอด SelectTextRange

Component: TPdfView  ·  Unit: PDFium
อ่านหรือเขียนโมเดลการเลือกข้อความแบบโปรแกรมของ TPdfView โดยไม่ต้องใช้อินพุตเมาส์จากผู้ใช้

Syntax

function SelectTextRange(Page, StartIndex, Count: Integer): Boolean;

Parameters

PageInteger. One-based page number
StartIndexInteger. Zero-based first character index
CountInteger. Number of characters to select

Return Value

Boolean. True เมื่อหน้าที่ร้องขอและช่วงอักขระถูกต้องและถูกเลือกอยู่

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