Below is a link to my site where you can see how Adobe interprets the Hits file. Feel free to grab both of these file for testing on your end.
http://www.lucion.com/files/HitsTest.pd ... tsFile.xml
When I try to incorportate the HitsFile into the ViewerAX via the HighlightTextByFile call, the highlighting is off and it produces objects that get saved out to the file if I do a save or saveas. This is bad. The hits shouldn't get saved and the modified property should not get set to 1 on account of this.
In the case of Adobe, if you do a SaveAs on the document in the link above, the PDF saves without the hit highlighting which is what you'd expect.
Below is the code I'm using.
Code: Select all
procedure TPDFViewerAX.HighlightTextByFile(ADocID: Integer; AFileName: String);
var
ADataIn, ADataOut: OLEVariant;
AModified: Boolean;
begin
if not IsValidDocID(ADocID) and not FileExists(AFileName) then exit;
AModified := Modified[ADocID];
try
ADataIn := AFileName;
FControl.DoDocumentVerb(ADocID, '', 'HighlightTextByFile', ADataIn, ADataOut, PXCVA_NoUI);
except end;
Modified[ADocID] := AModified;
end;