Annotations in Office files
Annotations made on a Word document or a workbook are saved into the .docx or .xlsx, where Word and Excel show them.
What Word and Excel get
| Annotation | In Word | In Excel |
|---|---|---|
| Rectangles, ellipses, lines, arrows, pens, polygons | Shapes placed on the page | Shapes over the cells they were drawn on |
| Highlight, underline, strike-out, squiggly | Shapes (highlights behind the text) | See-through shapes |
| Text boxes | Text boxes | Text boxes |
| Stamps, carets, attachments | Pictures | Pictures |
| Sticky notes and their replies | Word comments | Cell notes |
How it works
- The viewer’s
saveWord()andsaveExcel()keep the annotations inside the file, as annotations and as Office content. - When the file is opened in DocuVerse again, the Office copies are taken out and the annotations come back editable, so nothing appears twice.
- A workbook’s annotations are made right on its grid, so each one is kept on the cells under it (and a PDF download puts them on the printed pages, over the same cells).
From code
// keep a PDF document's annotations in a Word document (what saveWord() does)const list = pdfDoc.exportAnnotations();word.command({ cmd: 'annotations', set: JSON.stringify({ version: 1, pages: pdfDoc.pageCount, annotations: list }) });const docx = word.save();