Hi, I'm trying put a custom icon on a pdftron.PDF.Annots.Text, but I had no success. Researching on group I've found some suggestions using the property setAppearance, but apparently the component doesn't use the image I passed and loads a default icon. The image I'm trying to load is a png stored in android drawable resources. Follow the code I used in my tests:
ElementBuilder build = new ElementBuilder();
ElementWriter writer = new ElementWriter();
writer.begin(doc);
Image img = Image.create(doc, BitmapFactory.decodeResource(context.getResources(), R.drawable.my_icon));
int w = img.getImageWidth(), h = img.getImageHeight();
Element img_element = build.createImage(img, 0, 0, w, h);
writer.writePlacedElement(img_element);
Obj obj = writer.end();
pdftron.PDF.Annots.Text text = pdftron.PDF.Annots.Text.create(doc, p);
text.setAppearance(obj);
text.refreshAppearance();
Am I missing something?
Thanks in advance,
Hector Martins