How to remove horizontal/vertical scroll fix for pan tool

Which product are you using?
PDF.js Express Plus

PDF.js Express Version

Detailed description of issue
In some cases swiping document horizontally scrolls the document vertically. Thus, I want to make it scroll as I swiped.
This only happens on touchable devices with stylus mode on.
However, this can be reproduced using non touchable devices. Open chrome, opening dev tools(F12), toggling device toolbar and reloading page. Select tool button will come out when it worked.
Steps to reproduce:

  1. Zoom the document so you can scroll the document vertically and horizontally.
  2. Select Annotation ribbon, and select any of toolgroup tools e.g. freehand toolgroup.
  3. Swipe the document with finger vertically. The document should scroll vertically.
  4. Swipe the document with finger horizontally. The document will scroll vertically, not horizontally.

Expected behaviour
On step 4, the document should scroll horizontally.

Does your issue happen with every document, or just one?
Every document

Link to document

Code snippet

WebViewer({ path: publicPath, initialDoc: inlineUrl, licenseKey: licenseKey, css: cssPass}, element)
	.then((instance) => {


On step 2, when the selected tool was text select button or select tool button, step 4 scrolled vertically as it should be.
Maybe PanTool#switchOut not called properly on swiching back to toolgroups?

Kind regards,

Hi there,

Thank you for contacting pdf.js express forums,

On step 2, if you instead select the select tool, you should be able to pan vertically or horizontally:

Best regards,
Kevin Kim

Hi Kim,

Thank you for your solution.
However, what I want to achieve is to pan vertically and horizontally while selecting one of the annotation tools, not the select tool. Is this possible?

Kind regards,

Hi there,

Unfortunately, there is an issue with enableStylusMode for this use-case.

Alternatively, you could try out Apryse’ WebViewer as this is supported: WebViewer: JavaScript Document SDK | Apryse

Best regards,
Kevin Kim


If this is an issue, can you record this on your issue tracking system?
We are not in a hurry, so we will wait until this is fixed.

Kind regards,

Hi there,

We will add this to the backlog for the product team to review.

Best regards,
kevin Kim