Docs / Guides

Markdown

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

AnnotationIn WordIn Excel
Rectangles, ellipses, lines, arrows, pens, polygonsShapes placed on the pageShapes over the cells they were drawn on
Highlight, underline, strike-out, squigglyShapes (highlights behind the text)See-through shapes
Text boxesText boxesText boxes
Stamps, carets, attachmentsPicturesPictures
Sticky notes and their repliesWord commentsCell notes

How it works

  • The viewer’s saveWord() and saveExcel() 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();