dtSearch Publish

JObjects Highlighter Publisher Edition enables use of PDF highlighting with re-distributable search applications and publications such as those produced by dtSearch Publish.

PDF highlighting components for portable media do not require any special setup on the end-user's system and are fully functional in an offline environment. JObjects Highlighter server installation is only needed on the system where the master CD is created.

PDF highlighting components are compatible with all three dtSearch Publish interface types (Standard viewer, local, and Microweb HTTP server).

note

If you want to evaluate JObjects Highlighter with dtSearch Publish, please contact JObjects support for the Publisher Edition license key, the supported Highlighter distribution and the re-distributable assets archive.

The procss of adding JObjects Highlighter to a dtSearch Publish website consists of:

  1. Copying the JObjects Highlighter redistributable assets to the dtSearch Publish website.
  2. Enabling the integration JavaScript in the dtSearch template file.
  3. Building PDF highlighting cache.

Updating dtSearch CD Publication#

JObjects Highlighter redistributable assets file (download here) contains:

  • root/data/jquery.pdf-highlighter.js - PDF Highlighter integration JavaScript file
  • root/data/jquery-1.11.1.min.js - jQuery library
  • root/data/pdf-viewer/ - Folder with the Highlighting PDF Viewer
  • root/cgi-bin/dtpub_pdf_index.exe - Tool for building PDF documents cache
  • root/cgi-bin/dtpub_pdf_highlights.exe - Tool providing highlights to the viewer in runtime

1. Copy Highlighter redistributable assets#

Copy all Highlighter redistributable assets to your dtSearch Publish website - i.e. copy the complete root folder to the root of the dtSearch website.

2. Enable the integration script#

Add PDF Highlighter initialization script to the search results template. Open dtSearch_options.html using a text editor, lookup for the ResultsScript section, and just above its $End line add:

<script src="jquery-1.11.1.min.js"></script>
<script src="jquery.pdf-highlighter.js"></script>
<script>
$(function() {
$('.ResultsTable a').pdfHighlighterForDtPublish();
});
</script>

This will update all links to PDF documents to open in Highlighting PDF Viewer.

Note: If your dtSearch_options.html is not in the same folder as the referenced scripts, you need to update relative path to reflect script location.

3. Set IE compatibility mode#

dtSearch Publish website application internally uses Internet Explorer viewer component. Highlighting PDF Viewer requires IE 10 or newer but the website application, depending on environment settings, sometimes initializes IE at a lower compatibility level.

To make the website application run in the highest available IE compatibility mode, open dtSearch.html in editor and just below the line with <head>, add:

<meta http-equiv="X-UA-Compatible" content="IE=edge">

Building PDF Highlighter Cache#

If your website's content is under root/data/dtSearch, rename dtSearch to dtsearch (case change). dtSearch generates search results using dtsearch in file paths and this case difference would result in PDF file cache not being found by the highlighting component so PDF would not be highlighted.

To build the cache for PDF highlighting, run dtpub_pdf_index.exe (it's fine to double click in Windows Explorer). With its default settings, it will automatically index all PDF files under CD's root\data using the PDF Highlighter service installed on the same system. PDF cache data will be saved to the root\pdf-cache folder.

If you need to change any of these defaults, go to the command line and run dtpub_pdf_index -h for the list of available options.

During the runtime, when the PDF file open is requested, dtpub_pdf_highlights.exe uses the cache to build search term highlighting information for the HTML5 PDF viewer. This is automatically wired by the JavaScript added to the dtSearch options file.

After the cache is generated, the PDF Highlighter service is not needed any more and can be stopped.

Troubleshooting#

Q: When opening a PDF file in dtSearch Viewer, there is a script error like Expected ':' in URL http://localhost/pdf-viewer/pdf.viewer.js

A: Embedded IE instance running in dtSearch Publish Viewer opened document in compatibility mode emulating older IE version which doesn't work in HTML5 PDF viewer. See above how to set IE compatibility mode.