Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

c2.transform.msoffice

Make Microsoft Office files searchable in Plone.

The package adds a portal_transforms transform, msoffice_to_text, that extracts plain text from Word, Excel and PowerPoint files. Plone uses it to index the text of uploaded File objects, so a search finds words inside the documents.

Text is extracted by a bundled Java program (msdoc2txt.jar, built on Apache POI 5.5.1). Its source is in java/.

Supported versions

  • Plone 6.0, 6.1 and 6.2
  • Python 3.10 to 3.14 (as far as each Plone version supports them)
  • Java 11 or later on PATH (CI checks the jar with Temurin 11 and 21)
  • Linux and other POSIX systems. Windows is not supported.

Accepted MIME types

The transform is registered for these MIME types:

  • Word: application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-word.document.macroEnabled.12
  • Excel: application/vnd.ms-excel, application/msexcel, application/x-msexcel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel.sheet.binary.macroEnabled.12, application/vnd.ms-excel.sheet.macroEnabled.12
  • PowerPoint: application/vnd.ms-powerpoint, application/powerpoint, application/mspowerpoint, application/x-mspowerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.ms-powerpoint.presentation.macroEnabled.12

Tested formats

The tests extract text from .docx, .doc, .xlsx, .xls, .pptx and .ppt files, including the speaker notes of presentations. The other formats are passed to the jar but are not covered by the tests.

Installation

  1. Install Java 11 or later (a headless JRE is enough) so that java is on the PATH of the Zope process.

  2. Add c2.transform.msoffice to your project's dependencies, for example with pip:

    pip install c2.transform.msoffice
    
  3. Restart Zope and activate c2.transform.msoffice in the add-ons control panel (or apply the c2.transform.msoffice:default profile).

Existing File objects get their text indexed the next time they are reindexed, for example with "Clear and Rebuild" in the catalog.

Upgrading from 1.0b6

2.0 needs Java 11 or later; 1.0b6 ran on Java 8.

2.0 has no upgrade step from 1.0b6. After upgrading the package, deactivate the add-on and activate it again in the add-ons control panel. This replaces the transform that 1.0b6 registered.

1.0b6 used pkg_resources namespace packages; 2.0 uses PEP 420 namespace packages. If your site also uses other c2.* packages that still declare a pkg_resources namespace, install horse-with-no-namespace so that both kinds can be imported together.

How it works

For each document, the transform starts java with the bundled jar, writes the document to its standard input and reads the text from its standard output:

java -Xmx512m -Dfile.encoding=UTF-8 -Dstdout.encoding=UTF-8 -jar msdoc2txt.jar < document.docx
  • The text is always written in UTF-8, also when the process has no locale (as in slim container images).
  • The exit code decides success. A document without text gives empty text.
  • If java cannot be run, exits with an error or takes too long, the text is empty and an error is logged. Saving the file is not affected.
  • Neither the document, its text nor the error output of java is written to the log, because a Java exception can quote parts of the document. A failed run logs only its exit code.

Configuration

Set these environment variables for the Zope process:

  • C2_TRANSFORM_MSOFFICE_TIMEOUT: seconds to wait for java before it is killed. Default 60.
  • C2_TRANSFORM_MSOFFICE_JAVA_OPTS: JVM options, split like a shell command line. They replace the default -Xmx512m, for example -Xmx1g -XX:+UseSerialGC. The encoding options are always added.

Memory

Each transform runs its own JVM. Up to one JVM per Zope thread can run at the same time, each with a heap of up to 512 MB (by default) plus the memory of the JVM itself. Plan the memory of the server or container for that.

Uninstall

Deactivate the add-on in the add-ons control panel. This removes the transform. The MIME types are kept, because other add-ons may use them.

Source code

Credits

This code was inspired by Products.OpenXml.

Contributors

  • Manabu Terada (main code)
  • Mikio Hokari (Java code and extended calls)
  • Takashi Nagai (Windows support)
  • Takayuki Nagai (bug fix for 1.0b4)
  • Tetsuya Morimoto (refactoring of the Java code and POI 3.17 support)

License

c2.transform.msoffice is licensed under the GNU General Public License, version 2 or later. See LICENSE.txt and LICENSE.GPL.

The bundled msdoc2txt.jar contains libraries under the Apache License 2.0 (some of their license files have additional terms, for example for the ECMA-376 schemas in Apache POI) and under a BSD license (curvesapi). They are compatible with the package when it is used under the GPL version 3. The license files are in the jar, under META-INF/; see java/README.md.

Metadata

Release files for c2.transform.msoffice 2.0.0b1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for c2.transform.msoffice 2.0.0b1
File Size Uploaded Provenance Actions
c2_transform_msoffice-2.0.0b1.tar.gz 19.3 MB With provenance Details for c2_transform_msoffice-2.0.0b1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for c2.transform.msoffice 2.0.0b1
File Interpreter ABI Platform Actions
c2_transform_msoffice-2.0.0b1-py3-none-any.whl Python 3 none any Details for c2_transform_msoffice-2.0.0b1-py3-none-any.whl

Total release size: 38.7 MB

Release files / c2_transform_msoffice-2.0.0b1.tar.gz

Download URL c2_transform_msoffice-2.0.0b1.tar.gz
Size 19.3 MB
Tags Source
SHA-256 checksum
How to use checksums
a651e537884d8bd4ab89fd5b303d0aaaa30655241880da6eb9d857f1917f119e
BLAKE2b-256 checksum
How to use checksums
038645bd3b7977e8e8c41c76cb00fd361d62a6ac83ca8a5a2d0f5bfd883899f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / c2_transform_msoffice-2.0.0b1-py3-none-any.whl

Download URL c2_transform_msoffice-2.0.0b1-py3-none-any.whl
Size 19.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8bcd69f80b646b2e0f20f54194d36e6fb68c2ba9a641d136ccd17ba91069f1af
BLAKE2b-256 checksum
How to use checksums
9446d72ea90c07d2e55f82880932f91b10c5df3ff5476f53aecbba6be9fb3967
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for c2.transform.msoffice 2.0.0b1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for c2_transform_msoffice-2.0.0b1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page