Q:
In PDF Specification there is an option Highlight Style (None or
Invert or Outset or Outline) for link. How can i get and set the
Highlight Style for link using PDFTron?
----
A:
The 'Highlight Style' property is not available in the high-level
'PDF.Annot' class however just like with any other high-level class in
PDFNet it very simple to extract any required property. For example,
you can obtain Highlight Style as follows:
Annot annot = ...
Obj highlight = annot.GetSDFObj().FindObj("H");
if (highlight != null && highlight.IsName()) {
string st = highlight.GetName();
if (st == "N") { // No highlighting.
}
else if (st == "I") { // Invert
}
else if (st == "O") { // Outline
}
else if (st == "P") { // Push
}
}
Setting the highlight mode is as simple as the following:
annot.GetSDFObj().Put("H", Obj.CreateName("I"));