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이거나 기반 문서를 열지 못하면 뷰어는 예외 없이 비활성 상태로 남습니다
False로 두세요. 활성 상태에서 Pdf를 바꾸면 EPdfError가 발생합니다True로 설정해도 예외가 나지 않고 Active가 False로 남습니다. 실패 원인은 Pdf.LastLoadReport에서 확인하세요// 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;