Android SDK - Problems

Hi,
I am using pdfnet sdk for android, and I am facing few problems.

  • When I am using "Free Text " annotation, the enclosing box, which appears when we select the annotation, is bigger then the actual text inside it.(It’s looking weird)
  • The same enclosing box has a grey color translucent background. Can I change it’s opacity and color.
  • Another thing is, when we move the annotations on the doc, the page blurs, it’s not a smooth rendering.

Thank you in advance. :slight_smile:

Cheers,
Siddharth

  • When I am using "Free Text " annotation, the enclosing box, which appears when we select the annotation, is bigger then the actual text inside it.(It’s looking weird)

The free text annotations don’t really guarantee a minimal size. That being said, you should provide a screen shot showing what you mean, and what you expect to see.

  • The same enclosing box has a grey color translucent background. Can I change it’s opacity and color.

Yes, you can modify the calls to Annots.Markup.SetOpacity and Annots.Markup.SetInteriorColorCompNum and Annots.Markup.SetInteriorColor methods in the tools code.

  • Another thing is, when we move the annotations on the doc, the page blurs, it’s not a smooth rendering.

This is probably a complex document, that takes a long time to render, so you see a lower resolution placeholder instead.

Hey Ryan,
Thanks for the quick reply. I have attached to screenshots. Please take a look at them. For free hand drawings I am using Stamp annotation and for text I am using FreeText annotations.
Sorry for so many questions. :expressionless:

Regards,
Siddharth

This is what I get.png

What I am expecting.png

Hi Ryan,
Sorry, but I couldn’t find the code where you want me to change “Annots.Markup.SetOpacity and Annots.Markup.SetInteriorColorCompNum and Annots.Markup.SetInteriorColor methods in the tools code”. Please check and elaborate.

For FreeText look at the FreeTextCreate.java file.

Search for
“editor.putFloat(getOpacityKey(ToolManager.e_text_create), mOpacity);”
“mOpacity = settings.getFloat(getOpacityKey(ToolManager.e_text_create), Tool.PREFS_FREETEXT_OPACITY_DEFAULT);”
and
“freeText.setOpacity(mOpacity)”

that should get you started.

My colleague pointed out a few more things.

For the FreeText bounding box there is a fixed buffer value that inflates the box. See FreeTextCreate.java createFreeText() for value.

As for the grey color you are talking about, perhaps you are referring to the UI element as the user is editing the annotation. If so that is not part of the PDF annotation itself, but instead part of the UI element for editing. See AnnotEdit.java, onDraw()