Creating highlight programmatically

If you are a C/C++/C# developer and have any questions about using our products from your application here is the place to post them.
Post Reply
Posts: 33
Joined: Wed Dec 14 2005

Creating highlight programmatically

Post by beandog » Mon Mar 20 2006

As per the documentation, I tried doing the following:

PDF.CreateObject(CPDFCreactiveX::acObjectTypeHighlight, "HighlighterTest1");
PDF.put_ObjectAttribute("HighlighterTest1", "Left", COleVariant(200L));
PDF.put_ObjectAttribute("HighlighterTest1", "Top", COleVariant(200L));
PDF.put_ObjectAttribute("HighlighterTest1", "Right", COleVariant(600L));
PDF.put_ObjectAttribute("HighlighterTest1", "Bottom", COleVariant(400L));
PDF.put_ObjectAttribute("HighlighterTest1", "BackColor", COleVariant(CString("7FFFFF")));

This creates a highlight object, as far as I can tell, but it is not displayed correctly. It is not the specified color, but is instead white (transparent?). Anyway, simply changing the object type from Highlight to Text creates a rectangular textbox of the correct color at the correct location. So it's something specific to the highlight object. What am I missing?

Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002

Post by Joan » Tue May 08 2007


Please use this code instead:

Code: Select all

PDF.put_ObjectAttribute("HighlighterTest1", "Highlight Left", COleVariant(200L)); 
PDF.put_ObjectAttribute("HighlighterTest1", "Highlight Top", COleVariant
PDF.put_ObjectAttribute("HighlighterTest1", "Highlight Right", COleVariant
PDF.put_ObjectAttribute("HighlighterTest1", "Highlight Bottom", COleVariant
PDF.put_ObjectAttribute("HighlighterTest1", "BackColor", COleVariant(CString);
PDF.put_ObjectAttribute("HighlighterTest1", "BackColor", COleVariant(CString("7FFFFF"))); 

Hope this helps

Post Reply