Tutorial - PDF OutlineViewer

Top  Previous  Next

This code snippet demonstrates how to use gtPDFViewerX and gtPDFOutlineViewerX components to view the document and navigate using outline viewer.

 

See also 'Tutorial - PDF Viewer'

 

[VB]

 

       gtPDFDocumentX1.LoadFromFile (OpSvDlg.FileName)

       gtPDFViewerX1.PDFDocument = gtPDFDocumentX1

       gtPDFViewerX1.Active = True

 

       gtPDFOutlineViewerX1.PDFDocument = gtPDFDocumentX1

       gtPDFOutlineViewerX1.PDFViewer = gtPDFViewerX1

       gtPDFOutlineViewerX1.Active = True

 

 

[VC++]

 

       m_PDFDoc.LoadFromFile("InputFile");

 

       LPUNKNOWN pUnKnown = m_PDFDoc.GetControlUnknown();

       

       m_PDFViewer.SetPDFDocument((LPDISPATCH)pUnKnown);

       m_PDFViewer.SetActive(TRUE);

 

       LPUNKNOWN pUnKnownViewer = m_PDFViewer.GetControlUnknown();

 

       m_PDFOutline.SetPDFDocument((LPDISPATCH)pUnKnown);

       m_PDFOutline.SetPDFViewer((LPDISPATCH)pUnKnownViewer);

       m_PDFOutline.SetActive(TRUE);

 

[CS]

       

       PDFDoc.LoadFromFile ("InputFile");

       PDFViewer.PDFDocument = (PDFtoolkitX.gtPDFDocumentX) PDFDoc.GetOcx();

       PDFViewer.Active = true;

               

       PDFOutline.PDFDocument = (PDFtoolkitX.gtPDFDocumentX) PDFDoc.GetOcx();

       PDFOutline.PDFViewer = (PDFtoolkitX.gtPDFViewerX) PDFViewer.GetOcx();

       PDFOutline.Active = true;