javaitextpdf-annotations

Changing rollover mouse icon when hovering an annotaion


I am adding a link to an attachment using a PdfAnnotaion inside a pdf file i am creating.

How can i change the cursor of the mouse so when it hovers the link(PdfAnnotation), the cursor will change to something like a hand, so the user will know he can press on it?

Thanks.


Solution

  • You're talking about the Portable Document Format, asking for a feature that depends on the Operating System or the PDF Viewing application. That's a contradiction.

    In PDF, you can change the appearance of an annotation when the cursor of the mouse hovers over it, but you don't have access to the application or the OS to change the cursor. As there are no values for such a cursor defined in ISO-32000-1, the PDF can't possibly know if a cursor in the form of a hand is supported by any given viewer on any given OS.

    In short: you're asking for something that is impossible.