Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC:

set an icon to indicate the added hyperlink 6 years 8 months ago #12686

  • glzlaohuai
  • glzlaohuai's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
I want to add an hyperlink to a pdf file. And I use code below:
page.AddAnnotURI(rect, "http://www.radaeepdf.com/forum/newtopic");
The generated pdf file has nothing change visually, so I want to set an icon to indicate the added hyperlink, here is my code:
 page.AddAnnotURI(rect, "http://www.radaeepdf.com/forum/newtopic");
 //set an icon to indicate the added hyperlink
 page.GetAnnot(page.GetAnnotCount() - 1).SetIcon(R.drawable.pdf_custom_stamp);
Run above code cause an NullPointerException, GetAnnot(index) return null,.
My question is how to set an icon to indicate the added hyperlink, thanks.

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

set an icon to indicate the added hyperlink 6 years 8 months ago #12687

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
SetIcon is used to set icon for sticky text note/file attachment/Rubber Stamp annotations; so it wont work with hyperlink annotations.

To get the annotation you've just created:
if(page.AddAnnotURI(rect, "http://www.radaeepdf.com/forum/newtopic"))
            page.GetAnnot(page.GetAnnotCount() - 1);

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

  • Page:
  • 1
Powered by Kunena Forum