Share Share
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Submit your requests and polls about new features

TOPIC:

Annotations 12 years 11 months ago #2002

  • erikatomanderson
  • erikatomanderson's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Thank you for your fast response. I feel like it should be obvious, but I don't know where to get the bitmap in the first line of your example code.

Please Log in or Create an account to join the conversation.

Annotations 12 years 11 months ago #2011

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
just use Bitmap.createBitmap(width, height, ARGB8888);

Please Log in or Create an account to join the conversation.

Annotations 12 years 11 months ago #2022

  • erikatomanderson
  • erikatomanderson's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Ok, Thank you I got this to work... Mostly.

In the onAnnotEditBox method (PDFView.PDFAnnotListener), I call the annotSetEditText method to set the text. The text only shows up after I touch the annotation. Do you know what I need to call to make the text annotation show up without touching it?

Please Log in or Create an account to join the conversation.

Annotations 12 years 11 months ago #2035

  • erikatomanderson
  • erikatomanderson's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
I figured it out. The onAnnotEditBox method works when the annotation is selected. I used the following code to set the text from a dialog where I let the user set the text:

String value = input.getText().toString();
boolean result = pdfReader.annotAddEditText(x, y);
Page page = pdfReader.getCurrentPage();
if (result && page != null) {

// Assume the last annotation is the correct one
int annot = page.GetAnnot(page.GetAnnotCount() - 1);

page.SetAnnotEditText(annot, value);
pdfReader.get_viewer().viewGetDoc().Save();
}

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum