Q: We are indexing our PDF repositiories using a thrid party search
engine.
For search results, the engine generates XML highlight file that uses
character offsets to select text within a PDF page.
We would like to:
a) Generate a new PDF with text highlights
b) Generate PNG/JPEG thumbnail images with text highlights
-------
A: Starting with v.4.5 PDFNet supports Adobe's XML highlight format.
To add higlights to an exisiting PDF document simply call
doc.AddHighlights(higlight) where 'higlight' argument can be either a
path to a locally stored file or a string buffer containing actual
'XML' data.
PDFNet.Initialize();
PDFDoc doc = ...
doc.AddHighlights(@"c:/hilite.xml");
doc.Save(....);
doc.Close();
To generate PNG/JPEG thumbnail images with text highlights use PDFDraw
class (as shown in PDFDraw sample project - http://www.pdftron.com/pdfnet/samplecode.html#PDFDraw)
to render pages after calling AddHighlights().