Android SDK - Problems

54 views
Skip to first unread message

Siddharth Shah

unread,
Jan 13, 2015, 7:14:22 AM1/13/15
to pdfne...@googlegroups.com
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. :)

Cheers,
Siddharth

Ryan

unread,
Jan 13, 2015, 6:35:24 PM1/13/15
to pdfne...@googlegroups.com
- 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.
 

Siddharth Shah

unread,
Jan 13, 2015, 10:44:54 PM1/13/15
to pdfne...@googlegroups.com
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. :|

Regards, 
Siddharth
This is what I get.png
What I am expecting.png

Siddharth Shah

unread,
Jan 14, 2015, 12:07:14 AM1/14/15
to pdfne...@googlegroups.com
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. 

Ryan

unread,
Jan 14, 2015, 2:15:34 PM1/14/15
to pdfne...@googlegroups.com
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.

Ryan

unread,
Jan 14, 2015, 7:44:43 PM1/14/15
to pdfne...@googlegroups.com
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()
Reply all
Reply to author
Forward
0 new messages