dts_svr.exe provides a way to highlight hits in PDF files using a local-only HTTP server
The procedure to highlight hits in a local PDF file that was retrieved in a search is as follows:
Visual Basic Sample (from the vbsearch sample application)
Dim highlightInfo As String
highlightInfo = Results.MakePdfWebHighlightFile
If Not MadePdfHighlighter Then
Set PdfHighlighter = New dts_svr.Application
MadePdfHighlighter = True
End If
Dim PdfUrl As String
PdfUrl = PdfHighlighter.MakePdfUrl(fn, highlightInfo)
htmlViewer.Navigate (PdfUrl)C++ Example
In C++, use the MFC class wizard to make a C++ class for the type library in dts_svr.exe. In the calling application, make a dts_svr object, which should be kept until the program exits. Call MakePdfWebHighlightFile to make the xml stream, and then call MakePdfUrl to make a URL to use for CHtmlView::Navigate2().
if (!m_pPdfHighlighter) {
COleException error;
m_pPdfHighlighter = new Cdts_svr;
m_pPdfHighlighter->CreateDispatch(_T("dts_svr.Application"), &error);
}
DString highlightXml;
results->MakePdfWebHighlightFile(highlightXml);
CString csUrl = m_pPdfHighlighter->MakePdfUrl(results->DocName.getUi(), Utf8ToUi(highlightXml));
Navigate(csUrl);Software firewalls
Because dts_svr.exe communicates with Adobe Reader via HTTP, it may trigger a warning from some software firewalls. dts_svr.exe does not actually communicate with any other computer, but if the firewall software blocks dts_svr.exe from listening on an HTTP socket, then dts_svr.exe will not be able to respond to a request from Adobe Reader for the PDF file. Therefore, some firewall software may have to be configured to allow dts_svr.exe to communicate via HTTP.
The firewall software included with Windows XP Service Pack 2 will display a message the first time dts_svr.exe runs, but will not affect its function whether or not "Blocking" is enabled.
Highlighting hits in a client application using Adobe Reader 7
Some versions of Adobe Reader 7 could highlight hits in an embedded browser window even if the PDF file was referenced using a local path. However, this capability disappeared with the Adobe Reader 7.05 patch. Therefore, the HTTP-based method of highlighting hits is currently the only method that works consistently across Adobe Reader versions.
|
Copyright (c) 1995-2008 dtSearch Corp. All rights reserved.
|