v0.8.1
Added
getMainDocumentPart()returns the part targeted by the package-levelofficeDocumentrelationship, andopen()accepts anexpectingcontent type, or list of them, that the main document part must match. The library does not enumerate document kinds; callers pass the content types they support and getUnsupportedFileFormatExceptionfor anything else. The check reads the package relationships directly and runs before part names are validated and indexed, so rejecting a 1000-part package of the wrong kind costs about 2.5 ms instead of the 3.1 ms a full open takes.
Fixed
- A ZIP archive without
[Content_Types].xml, such as an OpenDocument file or a plain archive, is no longer detected as an OPC package.detect()reports it asUnknownandopen()throwsUnsupportedFileFormatExceptioninstead of the genericOpenXmlExceptionit raised after opening the archive.
See the full changelog.