Using GoToPage to scroll down to a docx Document

Hello!

I am using Collaboro and trying to send an unoCommand for when my document is loaded to go to a specific page thats being passed from the database.

postToCollabora({
      'MessageId': 'Send_UNO_Command',
      'Values': {
           'Command': '.uno:GoToPage',
        'Args': {
          'Page': { 'type': 'unsigned short', 'value': pageNumber }
        }
      }
    })

The only thing that seems to happen is a dialog box opens set to one and not even the correct page number. For example, the page number is 8 but the dialog box has it as 1.
Is there a way to get it to navigate directly to the page without opening a dialog box and to the correct page, any help would be appreciated.

I was also taking a look here:

and saw there was a JumpToSpecificPage for writer documents, but I don’t think its implemented in the collaboro repo after investigating it thoroughly. I would be willing to add it (if it’s not too complex), any help around this would be appreciated.

Really stuck on this, even trying to interact with the JSdialog so that I can input a number. So that we can go to the page thats linked directly, please let me know if there are any workarounds.

Hi @MooB
There is a feature used to prepare thumbnails for a specific elements inside document (Linking API - Making sure you're not a bot! ).
It can jump to specific “target”: online/browser/src/layer/tile/CanvasTileLayer.js at 8c92d0098ca9794b9998c38ad36ecbbffb527458 · CollaboraOnline/online · GitHub

It can be used by param passed to COOL iframe: online/browser/src/main.js at 8c92d0098ca9794b9998c38ad36ecbbffb527458 · CollaboraOnline/online · GitHub
Or you can reuse it’s .uno:OpenHyperlink uno command as you did.

To get idea what the target is, please experiment with Linking API I mentioned: `/cool/extract-link-targets`

1 Like