Highlighter background color

The PDF Creator .NET Library enables you to create secure PDF documents on the fly and to view, print and process existing PDF documents. If you have any questions about PDF Creator .Net, please post them here.
Post Reply
WFM
Posts: 21
Joined: Thu Jun 02 2005

Highlighter background color

Post by WFM »

Is there a way to set the color with the Highlighter?
Amyuni.PDFCreator.IacCommandTool.acCommandToolHighlight
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

In order to select or modify the default highlight color you will need to handle the FireNewObject() event and change the Highlight color then. When the event is fired you verify if object is a Highlight and if it, then you can change the BackColor property of the object.

I have included a C# code snippet which illustrate this.

private int pdfCreator1_FireNewObject(object sender, Amyuni.PDFCreator.IacEventArgs e) {
//Get the object type of the newly created object.
Amyuni.PDFCreator.IacAttribute attr =
e.acObject.Attribute("ObjectType");

if ( attr != null )

{
//Check if new object is a HighLight
if ( (int) attr.Value == (int)
Amyuni.PDFCreator.IacObjectType.acObjectTypeHighlight )

{

e.acObject.AttributeByName("BackColor").Value = 0x00FFFF; //Yellow

}

}

return 1;

}
Post Reply