readDocxMetadata function

BookMetadata readDocxMetadata(
  1. Uint8List bytes
)

Reads only the metadata from a DOCX package.

The required word/document.xml part is still validated so callers do not accidentally accept a random ZIP containing a core-properties file.

Implementation

BookMetadata readDocxMetadata(final Uint8List bytes) {
  final package = _DocxPackage.fromBytes(bytes);

  return _readDocxCoreMetadata(package.coreProperties);
}