property Active: Boolean; // default False
Active를 True로 설정하면 뷰어가 연결된 Pdf 컴포넌트가 참조하는 문서를 로드하고, PageNumber가 가리키는 페이지를 열고, 다시 그리기를 유발합니다. False로 설정하면 페이지를 닫고 캐시된 텍스트 페이지 핸들을 해제하며 찾기 세션을 버리고 보이는 영역을 지웁니다
Active는 뷰어의 마스터 스위치입니다. PageCount, PageWidth, PageLabel 같은 문서 관련 프로퍼티와 indexed 접근자(Character, Bitmap, WebLink 등)는 Active가 True이고 연결된 Pdf 인스턴스에 문서가 로드되어 있을 때만 의미 있는 값을 반환합니다
Pdf가 nil이면 뷰어는 Active가 처음 True로 설정될 때 내부 TPdf 인스턴스를 만들어 소유하므로, 미니멀한 프로그램은 파일을 가리킨 뒤 PdfView1.Pdf.FileName := ...; PdfView1.Active := True;만 호출하면 됩니다
True인 동안 Pdf를 다시 연결하면 새 문서를 자동으로 다시 로드합니다FileName, 버퍼, 스트림이 없이) Active를 True로 설정하면 예외가 발생합니다// 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;