Custom tooltip position

Skip to first unread message

kondaveeti sai prasanna

Mar 19, 2021, 12:22:50 PM3/19/21
to PDFTron WebViewer

As part of our implementation, we have added a new icon in pdftron webviewer header. Also, we have added tooltip property for the same.
Our requirement to show tooltip at the top of our custom icon rather than at bottom end. Is there any way we can configure our own tooltip position for the custom icons in pdftron webviewer?

Sai Prasanna K.

Andrew Yip

Mar 23, 2021, 2:29:12 AM3/23/21
to PDFTron WebViewer

There isn't really a nice way of doing this. Currently the tooltip calculate how much room is left in the window and place the tooltip in the place that make the most sense. One thing you can do is manually override the CSS style, see the following guide for how to use your own CSS file to style WebViewer

You would want to do something like the following

  transform: translateY(-250%);

.tooltip--bottom > .tooltip__content::before {
  transform: translateY(35px);
  left: 50% !important;
  margin-left: -8px !important;
  border-left: 8px solid transparent !important;
  border-right: 8px solid transparent !important;
  border-top: 6px solid #222 !important;
  border-bottom: 0px !important;

This is a bit awkward but will cause the tooltip to be above be above the button. You can change the CSS selector to better target which header button you want the tooptip to be above. One thing to note is since WebViewer is in an iframe, the tooltip won't be allowed to overflow outside of it. Please let me know if the above helps or if you have any other related questions

Best Regards,
Andrew Yip
Software Developer
PDFTron Systems, Inc.
Reply all
Reply to author
0 new messages