Docx Versions Save

Easily generate and modify .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.

7.4.0

1 year ago

https://github.com/dolanmiu/docx/pull/1363 - Run borders https://github.com/dolanmiu/docx/pull/1558 - #1528 Adding numbering replacer on header and footer https://github.com/dolanmiu/docx/pull/1552 - #1529 Add word break feature https://github.com/dolanmiu/docx/pull/1523 - Improve documentation https://github.com/dolanmiu/docx/pull/1491 - #1487 Create union type for IFrameOptions https://github.com/dolanmiu/docx/pull/1384 - Fix reading template images in the browser https://github.com/dolanmiu/docx/pull/1448 - Implement sample version of Comment feature. https://github.com/dolanmiu/docx/pull/1562 - removed "both" as a verticalAlign feature

7.3.0

2 years ago

https://github.com/dolanmiu/docx/pull/1317 - support style changes in revisions https://github.com/dolanmiu/docx/pull/1323 - Add an ability to specify charSpace and type for DocumentGrid https://github.com/dolanmiu/docx/pull/1325 - Fix Bidi issue https://github.com/dolanmiu/docx/pull/1326 - Updated SVG Logo - Supports Dark Mode! https://github.com/dolanmiu/docx/pull/1345 - Add exception if level exceeds over 9

7.1.1

2 years ago

Turn module into ES6

7.1.0

2 years ago

Re-activated absolute-types-fixer to fix typing issue https://github.com/dolanmiu/docx/pull/1196 https://github.com/dolanmiu/docx/pull/1199

7.0.0

2 years ago

image

https://github.com/dolanmiu/docx/pull/868 - Update Webpack 3 to Webpack 5 and testing frameworks https://github.com/dolanmiu/docx/pull/928 - Added support for w:fldSimple, including convenience for MailMerge https://github.com/dolanmiu/docx/pull/948 - Conform to XML schema https://github.com/dolanmiu/docx/pull/1031 - Column Break https://github.com/dolanmiu/docx/pull/1057 - Numbering start from number doesn't work fix https://github.com/dolanmiu/docx/pull/1074 - PageRef feature https://github.com/dolanmiu/docx/pull/1163 - Attaching numbering to custom style https://github.com/dolanmiu/docx/pull/1169 - Use correct height rule https://github.com/dolanmiu/docx/pull/1168 - Extend Columns API to allow specifying individual column widths/spacing

https://github.com/dolanmiu/docx/pull/956 - V7 Work https://github.com/dolanmiu/docx/pull/1120 - Multiple children in hyperlinks https://github.com/dolanmiu/docx/pull/1131 - Add ParagraphChild in Bookmark

New features

In several places, as allowed by the spec, Universal Measure units can now be used. Universal Measure units are strings in the format /-?[0-9]+(.[0-9]+)?(mm|cm|in|pt|pc|pi)/, for example: "14pt", "20mm", "2in", "2cm". These include page margins, page size, paragraph indents, and font sizes. These should be experimented with, some of these may not work and need testing -- even if it's technically valid according to the spec.

Added a bunch of formats to NumberFormat.

Much more compliant docx files, which should act more consistently in different editors.

Reduced bundle size slightly.

Boolean options like bold, etc can now be explicitly toggled off -- when set to false it adds the tag to disable it, rather than just omit the tag to enable it, which allows more flexibility.

Breaking changes

Renamed enum PageNumberFormat -> NumberFormat.

Section vertical align enum changed: SectionVerticalAlignValue -> VerticalAlign

Runtime checks were added for some values. These can now throw errors for invalid arguments in some cases.

color values must now be in hex (eg "00CCFF") for Underline, Shading, run color, background color, border color

Paragraph border argument signature changed. old:

  new Paragraph({
      border: {
          top: {
              value: "single",
              size: 6,
              color: "red",
          },
      }
  })

new:

  new Paragraph({
      border: {
          top: {
              style: BorderStyle.SINGLE,
              size: 6,
              color: "FF0000",
          },
      }
  })

For TableOfContents, updateFields option in Document must be explicitly set:

new Document({
  features: {
      updateFields: true,
  },
  // ...
})

ITableShadingAttributesProperties changed to IShadingAttributesProperties

Table and TableCell shading option signature changed to be consistent with shading everywhere else.

old:

  shading: {
      val: ShadingType.REVERSE_DIAGONAL_STRIPE,
      color: "00FFFF",
      fill: "FF0000",
  },

new:

  shading: {
      type: ShadingType.REVERSE_DIAGONAL_STRIPE,
      color: "00FFFF",
      fill: "FF0000",
  },

A great many internal classes were shifted around or removed. Internal methods were removed in several places. These changes should not affect you if you stuck to the public API (what's in the demos and docs)

6.0.2

3 years ago

https://github.com/dolanmiu/docx/issues/851 - Fix complex numbering and add demo for it