Force tool button panToolButton starting enabled by default

Which product are you using?
PDF.js Express Viewer

PDF.js Express Version
PDF.js Express Free Viewer

Detailed description of issue
Programmatically in javascript I want “click” or enabled tool button “panToolButton”

Expected behaviour
imagen

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

Link to document
nop

Code snippet
nop

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

1 Like

Hi Luigi,

Thanks for your question.

Here is a code snippet to help you enable the panToolButton.

import WebViewer from '@pdftron/pdfjs-express-viewer'

WebViewer({
...options
}).then(instance => {

const { Tools } = instance.Core;

const panTool = Tools.ToolNames.PAN;

instance.UI.setToolMode(panTool);

})

Hope this helps and let me know if this approach works for you.

Thank you,

Dandara

2 Likes

Hi Dandara!!! Sounds good and works perfectly!!! Thanks!!! You win a “paella valenciana”, I’m from Valencia (Spain) :wink:. See you my next problem. :joy:

2 Likes