Mobile & touch
Pinch zoom, two-finger rotate, swipe, long-press, palm-rejected stylus input, and a responsive toolbar that folds excess actions into an overflow menu on narrow viewports.
Touch gestures
import { bindTouchGestures } from '@trupdf/viewer';
bindTouchGestures(host, { engine, sensitivity: 1 });| Gesture | Action |
|---|---|
| Single-finger drag | Pan |
| Two-finger pinch | Zoom |
| Two-finger rotate | Rotate page |
| Two-finger swipe | Page nav |
| Long-press | Context menu (annotation hit-testing) |
| Double-tap | Zoom-to-fit / zoom-to-text-region |
Stylus & pen
import { bindStylusInput, applyPressureCurve } from '@trupdf/viewer';
bindStylusInput(canvas, {
pressureCurve: applyPressureCurve('firm'),
palmRejection: true,
coalesce: true,
});- Apple Pencil (iPad) — via PointerEvents; pressure, tilt, twist.
- S Pen (Android Galaxy) — via PointerEvents.
- Wacom tablets — via PointerEvents on Chrome / Edge.
- Catmull-Rom stroke smoothing.
- Coalesced events for low-latency ink rendering.
- Palm rejection on by default.
Responsive toolbar
Buttons are 36 px on mouse pointers, 44 px on coarse pointers (matches Apple HIG / Material touch target). The toolbar folds excess actions into an overflow menu on narrow viewports.
CSS auto-detect:
@media (pointer: coarse) {
.trupdf-viewer {
--trupdf-button-size: 44px;
}
}Collapsible panels
On small screens the left dock (thumbnails / outline / comments) collapses to a fly-out drawer. Trigger via the hamburger or a swipe gesture from the left edge.
iOS / iPadOS
- File picker uses
input[type=file], which iOS surfaces through the Files app and iCloud. - PencilKit bridge planned (Phase 6 follow-up) for native ink → XFDF.
- Standalone PWA install supported when hosted at
trupdf.truenotech.com.
Android
- File picker uses the system Storage Access Framework.
- S Pen hover preview supported on Galaxy Tab / Note devices.
- File attachment open uses the share intent.
See also
- Customization → Theming — adjust the touch target tokens.
- Customization → Keyboard — on- screen-keyboard quirks.