docx

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

MIT License

Downloads
690.7K
Stars
4K
Committers
104

Bot releases are visible (Hide)

docx - 7.4.1

Published by dolanmiu over 2 years ago

docx - 7.4.0

Published by dolanmiu over 2 years 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

docx - 7.3.0

Published by dolanmiu almost 3 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

docx - 7.1.2

Published by dolanmiu almost 3 years ago

docx - 7.1.1

Published by dolanmiu about 3 years ago

Turn module into ES6

docx - 7.1.0

Published by dolanmiu about 3 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

docx - 7.0.0

Published by dolanmiu about 3 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)

docx - 6.0.2

Published by dolanmiu over 3 years ago

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

docx - 6.0.1

Published by dolanmiu over 3 years ago

docx - 6.0.0

Published by dolanmiu over 3 years ago

image

Breaking Changes

https://github.com/dolanmiu/docx/pull/784 - Simpler Hyperlink API - Breaking change
https://github.com/dolanmiu/docx/pull/565 - Table Row height rename - Breaking change
https://github.com/dolanmiu/docx/pull/484 - Multiple paragraphs in footnotes - Breaking change
https://github.com/dolanmiu/docx/pull/822 - Rotate and flip images - Breaking change
https://github.com/dolanmiu/docx/pull/827 - Make lineRule into a enum - Breaking change
https://github.com/dolanmiu/docx/pull/834 - Make images declarative and simplier to use - Breaking change
https://github.com/dolanmiu/docx/pull/840 - Make addSection fully declarative and remove method - Breaking change
https://github.com/dolanmiu/docx/pull/829 - Remove default header - Breaking change

Non-breaking Changes

https://github.com/dolanmiu/docx/pull/780 - Section types
https://github.com/dolanmiu/docx/pull/783 - Fix compatibility mode message
https://github.com/dolanmiu/docx/pull/785 - Fix Hyperlinks in headers and footers
https://github.com/dolanmiu/docx/pull/605/ - Custom Properties
https://github.com/dolanmiu/docx/pull/789 - Allow external hyperlinks in footnotes
https://github.com/dolanmiu/docx/pull/795 - Visual Right to Left Table
https://github.com/dolanmiu/docx/pull/796 - Line between section columns (seperate)
https://github.com/dolanmiu/docx/pull/438 - Add style to table
https://github.com/dolanmiu/docx/pull/511 - Restart page numbering
https://github.com/dolanmiu/docx/pull/763 - Allow styles and headings with numbering
https://github.com/dolanmiu/docx/pull/816 - Restart numbered lists
https://github.com/dolanmiu/docx/pull/819 - Widow Control
https://github.com/dolanmiu/docx/pull/821 - Text Frames (Text boxes)

docx - 5.5.0

Published by dolanmiu over 3 years ago

https://github.com/dolanmiu/docx/pull/697 - Default styles
https://github.com/dolanmiu/docx/pull/728 - Default strong style
https://github.com/dolanmiu/docx/pull/729 - Add TableBorders.NONE convenience object
https://github.com/dolanmiu/docx/pull/734 - Make break() delcarative. Make docx align with documentation
https://github.com/dolanmiu/docx/pull/735 - Add Convenience functions
https://github.com/dolanmiu/docx/pull/736 - Use LevelFormat string enum rather than strings - Note: This should not be a breaking change as string enums and strings are identical, but you may get a compile error which can be easily fixed.
https://github.com/dolanmiu/docx/pull/739 - Add z-index to floating

docx - 5.4.1

Published by dolanmiu almost 4 years ago

docx - 5.4.0

Published by dolanmiu almost 4 years ago

docx - 5.3.0

Published by dolanmiu about 4 years ago

feat: Add decimalFullWidth numbering type #596 - https://github.com/dolanmiu/docx/pull/596

docx - 5.2.2

Published by dolanmiu over 4 years ago

rowSpan can't work when column index out of range - https://github.com/dolanmiu/docx/pull/559

docx - 5.2.1

Published by dolanmiu over 4 years ago

docx - 5.2.0

Published by dolanmiu over 4 years ago

docx - 5.1.1

Published by dolanmiu over 4 years ago

Revert change which broke docx