Tooltip on Annotation not showing

WebViewer Version:
10.8.0

Do you have an issue with a specific file(s)?
No

Can you reproduce using one of our samples or online demos?
No

Are you using the WebViewer server?
No

Does the issue only happen on certain browsers?
No

Is your issue related to a front-end framework?
No

Is your issue related to annotations?
Yes

Please give a brief summary of your issue:
TextHighlightAnnotation tooltip isn’t showing after upgrading from 10.4 to 10.8

Please describe your issue and provide steps to reproduce it:
After upgrading from 10.4.0 to 10.8.0 and switching to the WebComponent, the tooltips on my programmatically added TextHighlightAnnotations are not longer showing. I’ve searched through your documentation but can’t find anything about how to control the tooltip.

All of the code below occurs immediately after the document is loaded.

I create the annotations then add them to the annotationsManager

validAnnotations.forEach((a) =>
  annotationManager.addAnnotation(createTextHighlightAnnotation(Annotations, a))
)

annotationManager.drawAnnotations({ pageNumber: documentViewer.getCurrentPage() })

createTextHighlightAnnotation.ts

function createTextHighlightAnnotation(
  Annotations: typeof Core.Annotations,
  raw: IPdfViewerAnnotation
) {
  const { customData, id, page, quads, title } = raw

  const annotation = new Annotations.TextHighlightAnnotation({
    Author: 'Key Term',
    IsHoverable: true,
    PageNumber: page,
    Quads: quads,
  })

  annotation.setContents(title)
  annotation.setCustomData('id', id)

  if (customData) {
    Object.entries(customData).forEach(([key, value]) => annotation.setCustomData(key, value))
  }

  annotation.StrokeColor = new Annotations.Color(
    ...hexToRgb(MUTED_HIGHLIGHT_COLOR),
    DEFAULT_HIGHLIGHT_ALPHA
  )

  return annotation
}

What’s the prescribed way to show (and control the contents) of a tooltip when hovering over an annotation?

Hello @brandonitga,

Are you referring to the tooltips which appear like this? :

If so, we are currently aware of an issue where tooltips are not currently showing up when using WebComponent.

We don’t have a timeline for when it will be fixed but if it does get fixed we’ll let you know when it’s available in an experimental build to test out and the estimated official release date.

In the meantime, I was able to get tooltips working if not using WebComponent and using iframe instead. We suggest using this as a workaround in the meantime.

Feel free to let me know if I have misunderstood your use case.

Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer
Apryse Software Inc.

1 Like