Tutorial - PDF SearchPanel

Top  Previous  Next

This code snippet demonstrates how to use gtPDFSearchPanelX with gtPDFDocumentX and gtPDFViewerX to search for text in the document and navigate to it.

 

[VB]

 

      gtPDFDocumentX1.LoadFromFile (OpSvDlg.FileName)

       gtPDFViewerX1.PDFDocument = gtPDFDocumentX1

       gtPDFViewerX1.Active = True

 

       gtPDFSearchPanelX1.PDFDocument = gtPDFDocumentX1

       gtPDFSearchPanelX1.PDFViewer = gtPDFViewerX1

       gtPDFSearchPanelX1.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_PDFSearchPanel.SetPDFDocument((LPDISPATCH)pUnKnown);

       m_PDFSearchPanel.SetPDFViewer((LPDISPATCH)pUnKnownViewer);

       m_PDFSearchPanel.SetActive(TRUE);

 

[CS]

       

       PDFDoc.LoadFromFile ("InputFile");

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

       PDFViewer.Active = true;

               

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

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

       PDFSearchPanel.Active = true;