ONLYOFFICE / sdkjs-plugins

The add-ons for ONLYOFFICE Document Server and ONLYOFFICE Desktop Editors.
https://www.onlyoffice.com
Apache License 2.0
136 stars 134 forks source link

How to get actual ids of Paragraphs in a plugin? #92

Open anirudhvarma12 opened 4 years ago

anirudhvarma12 commented 4 years ago

It looks like OnlyOffice replaces the paragraph ids generated by Word to its own ids. Is there any way to get the word id(s) of the paragraphs?

ShockwaveNN commented 4 years ago

@flaminestone take a look please

flaminestone commented 4 years ago

Hi @anirudhvarma12. There are no public methods for getting paragraph ids at now. I recommendet to use content controls for work with paragraphs/runs.

anirudhvarma12 commented 4 years ago

The problem with using content controls would be that they are visible to the user, we wanted something that is not visible to the user and can be used to track content. Any recommendations for that? Can we have an invisible content control?

flaminestone commented 4 years ago

No, content controls can not be invisible. I need some examples for understanding) Can you give more details?

anirudhvarma12 commented 4 years ago

We have some internal tools which require us to be able to track paragraph id. If you can give some pointers, I can open an MR also to add this functionality to the sdk.

KirillovIlya commented 4 years ago

First of all, you can hide the track around the content control.

  1. Content Control Settings
  2. Appearance
  3. Show as "None"

Tell me pls, which paragraph id we are replacing? I mean which subnode or attribute of a we are replacing. In fact, we have our internal id's for paragraphs, but we do not replace anything with them.

anirudhvarma12 commented 4 years ago

I was talking about the para:id https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.wordprocessing.paragraph.paragraphid?view=openxml-2.8.1#DocumentFormat_OpenXml_Wordprocessing_Paragraph_ParagraphId.

Is there any way to read this property from a paragraph?