PDFium Delphi Component Docs

Active 속성

컴포넌트: TPdfView  ·  유닛: PDFium
viewer를 활성화하거나 비활성화하며, 연결된 PDF document를 열고 선택한 page를 렌더링합니다

구문

property Active: Boolean; // default False

설명

Active를 True로 설정하면 뷰어가 연결된 Pdf 컴포넌트가 참조하는 문서를 로드하고, PageNumber가 가리키는 페이지를 열고, 다시 그리기를 유발합니다. False로 설정하면 페이지를 닫고 캐시된 텍스트 페이지 핸들을 해제하며 찾기 세션을 버리고 보이는 영역을 지웁니다

Active는 뷰어의 마스터 스위치입니다. PageCount, PageWidth, PageLabel 같은 문서 관련 프로퍼티와 indexed 접근자(Character, Bitmap, WebLink 등)는 Active가 True이고 연결된 Pdf 인스턴스에 문서가 로드되어 있을 때만 의미 있는 값을 반환합니다

Active를 True로 설정하기 전에 TPdf 컴포넌트를 Pdf에 연결하세요. Pdf가 nil이거나 기반 문서를 열지 못하면 뷰어는 예외 없이 비활성 상태로 남습니다

참고 사항

예제

// Bind to an explicit TPdf and open a file.
PdfView1.Pdf := Pdf1;
Pdf1.FileName := 'C:\docs\sample.pdf';
PdfView1.Active := True;

// React to open/close in code.
if PdfView1.Active then
  StatusBar1.SimpleText := Format('%d pages', [PdfView1.PageCount])
else
  StatusBar1.SimpleText := 'No document loaded';

// Close the viewer.
PdfView1.Active := False;

관련 항목

Pdf, PageNumber, PageCount, ReloadPage, TPdf.Active