Release Notes
v3.5
New Features
- AlternateContent Support: The engine now correctly handles
AlternateContentelements, ensuring that placeholders and comments within these blocks are processed. - PowerPoint Image Stamping:
PowerpointStampernow supports filling shapes with images when a placeholder resolves to anImageobject. - CLI Watch Mode: Added a
--watchflag to the CLI for automatic re-stamping on file changes. - Traceability Reporting: Introduced
TraceabilityReporterand CLI options to generate detailed JSON and HTML reports of placeholder resolutions. - Multi-tab Excel Context: The CLI can now load Excel files with multiple tabs and treat them as independent or joined tables.
- AsciiDoc Previews: Integrated with
pro.verron.asciidocto provide previews of AsciiDoc content as images (SVG/PNG) within documents.
v3.4
Major changes
- Image API Refactor: The
Imageclass constructors now useInputStreamfor improved flexibility and memory efficiency. Internal byte caching and deduplication ensure that identical images are only stored once in the generated document. - Dedicated ImageIO Service Providers: New modules provide ImageIO service providers for EMF, WMF, and SVG formats, replacing the internal image handling of docx4j with a more robust and extensible system.
- Excel Module: Introduced a dedicated module for an Excel file wrapper that acts as a queryable context for SpEL, allowing for data extraction from Excel files within templates.
New Features
- Asciidoc Docx-to-Text: The asciidoc compiler can now output a textual representation of DOCX files (skipping section information), facilitating easier diffing in tests.
- Sitemap and Robots: Added
sitemap.xmlandrobots.txtto the documentation site for better SEO. - New Logo: Updated the Office-stamper logo.
Refactorings
- Security Settings: Deprecated
EvaluationContextFactoriesin favor of new security settings inOfficeStamperConfigurations. - Module and GroupId Renaming: Several modules and group IDs have been renamed for better consistency across the project.
- Custom Maven Skin: Developed a custom maven-skin for the documentation site based on the verron.pro blog style.
Tooling and Experiments
- Native CLI: Experiments with building a native CLI for Office-stamper using GraalVM.
- Documentation Domain: The documentation website has moved to a new domain: office-stamper.verron.pro
v3.3
Major changes
- SVG Support: Office-stamper now supports inserting SVG images into documents.
The
Imageclass has been updated to automatically detect SVG content and handle its insertion using a newWmlFactory.newSVGDrawingmethod.
New Features
- Smart Tag Attribute Validation: A new utility method
WmlUtils.hasTagAttributeallows for checking the existence and value of attributes within DOCX smart tags.
Refactorings
- Internal Cleanup: Removed
ByteUtilsandDocxRendererfrom theutilsmodule as part of an internal refactoring to streamline the codebase.
v3.2
Major changes
- Expression API Refactor: Replaced
ExpressionParserwith a newExpressionabstraction. This improves the internal handling of expressions and allows for better support of different expression languages. - Table and Row Manipulation: Introduced new
TableandTable.Rowinterfaces to the public API. Custom processors can now easily remove tables or rows, copy rows, and access parent table/row structures directly from a paragraph. - Asciidoc Module Overhaul: Significant enhancements to the AsciiDoc module, including support for nested tables, hyperlinks, headers, footers, and improved text extraction.
New Features
- Comment Removal: Added
CommentRemoverpost-processor, allowing for the automatic removal of all comments from the document after processing. - Configuration Presets: Enhanced
OfficeStamperConfigurationswithminimal(),standard(), andfull()presets to provide better out-of-the-box behavior for various use cases.
v3.1
Major changes
- API Consolidation: Continued streamlining of the public API by moving core interfaces like
PlaceholderHooker,CommentHooker, andHookRemoverto thepro.verron.officestamper.apipackage. - Internal Cleanup: Removed several internal utility classes and simplified the engine’s internal structure for better maintainability.
- Experimental Features: Moved experimental stamper implementations to a dedicated
pro.verron.officestamper.experimentalpackage to clearly distinguish them from the stable API.
Breaking API Changes
- Java Version: Java 17+ is required; Maven release set to 25.
- Package Moves:
PlaceholderHooker,CommentHooker, andHookRemovermoved topro.verron.officestamper.api.ExperimentalStampersmoved topro.verron.officestamper.experimental.
- Class Deletions: Removed several internal classes that were previously exposed but intended for internal use only:
SectionUtil,RemoveTagsProcessor,TagsVisitor,ParagraphCollector,CRSCollector, andPrepareCommentProcessors. - Post-processing: The
cleanTagsfunctionality has been replaced byPostprocessors.removeTags(String).
v3.0
Major changes
- Processing model overhaul: the engine now iterates hooks in strict document order.
The API around iteration has been adapted accordingly.
Consult the root file
3.0_UPDATE.mdfor details and migration notes. - Introduced the hook concept: a hook represents a concrete target point in the DOCX to process (e.g., placeholder smart-tags, inline processors, and comments) and is the unit the iterator walks through.
- New hierarchical scopes with
ContextTree. If a placeholder cannot resolve in the current scope, resolution walks up the branch (parent, then ancestors). Comment processors that create sub-scopes (e.g., repeaters) can control whether a hook evaluates in a nested branch or reuses the current one. - Placeholders are now resolved from smart-tags produced by preprocessors.
Ensure the appropriate placeholder preprocessor is included in your
OfficeStamperConfiguration(standard presets already do this). - Simplified lifecycle for comment processors: a processor instance is created for each encountered comment and executed once.
Breaking API Changes
AbstractCommentProcessorwas renamed and simplified intoCommentProcessor.- Removed mutating setters on the
Commentinterface. - All previously
@DeprecatedAPI methods have been removed. - Introduced
@FunctionalInterface CommentProcessorFactoryto create aCommentProcessorfrom aProcessorContext. - Removed
DocxDocumentfrom the public API;DocxPartcovers previous use cases. - Replaced
EvaluationContextConfigurerwithEvaluationContextFactory. Provide a factory that creates a freshEvaluationContextper hook. - Introduced
Insertin the API, allowing resolvers to return content that spans multiple runs instead of a single run. OfficeStampernow focuses onOpcPackagehandling. Stream-based stamping is handled by the dedicatedStreamStamperinterface.- Expression parsing is configurable: you can supply your own
org.springframework.expression.ExpressionParser(SpEL by default). ContextDependentwas renamed toHook.ProcessorContextnow includes theContextTreeandexpression.DocxStamper#stampnow returns the stamped document.
For a complete migration guide and code examples, see 3.0_UPDATE.md and the contributor‑focused HOW_DOES_IT_WORKS.adoc.
Minor changes
- Dependencies: upgraded Spring Expression/Context to 7.0.2 (from 6.2.12).
- Documentation: added an in‑depth how‑to for building custom resolvers and comment processors at
engine/src/site/asciidoc/how-to-custom.adoc. - Documentation: added a deeper architectural overview for contributors in
HOW_DOES_IT_WORKS.adoc. - Tests: extended Docx4J test matrix to include 11.5.7 and 11.5.8.
- Modules: added an
asciidocmodule to experiment with AsciiDoc ↔ DOCX conversion (useful for tests). - Modules: added a
utilsmodule exposing common utilities; some utilities may spin off into dedicated projects later.
v2.9.0
Bugfixes
- MAY BREAK: Changed behavior of the processor
replaceWordWith(context)to be able to handle several test run as notified by @jonath92 in #585- It may break the formatting of the following paragraphs if there was an empty run with formatting instruction inside the comment selection, but I have not been able to reproduce this theoretical issue with both Word, and WPS writer. Do not hesitate to inform me if you encounter the issue.
Dependencies
- Upgrade Java version from 21 to 25
- Bump
org.springframework:spring-expressionfrom6.2.8to6.2.12 - Bump
org.springframework:spring-contextfrom6.2.8to6.2.12
Documentation
- Updated all Javadoc to use Markdown style
- Globally added a lot of Javadoc, to improve self-documentation and leverage AI capabilities.
- Add documentation about preprocessors, allowing cleanup of documents before stamping
- Added an .aiignore to improve the vibe coding experience
- Add contributors details to generated documentation site
Continuous Integration
- Updated deployment to Maven Central to follow OSSRH process changes.
- Added dependency to plugin
org.sonatype.central:central-publishing-maven-plugin:0.9.0
- Added dependency to plugin
- Bump
actions/checkoutfromv4tov5 - Bump
actions/setup-javafromv4tov5 - Bump
github/codeql-action/analyzefromv3tov4 - Bump
actions/upload-pages-artifactfromv3tov4 - Bump
org.apache.maven.plugins:maven-compiler-pluginfrom3.14.0to3.14.1 - Bump
org.apache.maven.plugins:maven-javadoc-pluginfrom3.11.2to3.12.0 - Bump
org.apache.maven.plugins:maven-surefire-pluginfrom3.5.3to3.5.4 - Bump
org.apache.maven.plugins:maven-surefire-report-pluginfrom3.5.3to3.5.4 - Bump
org.jacoco:jacoco-maven-pluginfrom0.8.13to0.8.14
v2.8.0
Features
- EXPERIMENTAL — Developing a Command Line Interface (CLI) for Office-stamper, enabling direct stamping with practical default settings, drawing inspiration from the provided examples.
- Added Google Doc to the list of supported editors
- Improved management of SdtRun as stampable elements of DOCX
Bugfixes
- Fixed management of comment made in Google Doc, as mentioned by @Jushar in #534
- Fixed management of instrText in TOC, as mentioned by @tiagobutzke in #539
Dependencies
- Bump
org.docx4j:docx4j-corefrom11.5.1to11.5.3 - Bump
org.docx4j:docx4j-JAXB-ReferenceImplfrom11.5.1to11.5.3 - Bump
org.springframework:spring-expressionfrom6.2.1to6.2.8 - Bump
org.springframework:spring-contextfrom6.2.1to6.2.8
Documentation
- Massive rework of the documentation, now most of it is on the site
- Add a Style Guide, notably to improve AI assistants correctness
- Improve the bug report form to include Docx editor used and reduce analysis time
- Bump
org.apache.maven.skins:maven-fluido-skinfrom1.11.1to2.1.0 - Bump
org.asciidoctor:asciidoctor-maven-pluginfrom3.1.1to3.2.0 - Added
org.asciidoctor:asciidoctor-parser-doxia-moduleversion3.2.0
Continuous Integration
- Add the sonarlint configuration, for contributors that would like to see the list of issues
- Bump
org.apache.maven.plugins:maven-compiler-pluginfrom3.13.0to3.14.0 - Bump
org.apache.maven.plugins:maven-surefire-pluginfrom3.5.2to3.5.3 - Bump
org.junit.jupiter:junit-jupiterfrom5.11.4to5.13.3 - Bump
org.apache.maven.plugins:maven-surefire-pluginfrom3.5.2to3.5.3 - Bump
org.jacoco:jacoco-maven-pluginfrom0.8.12to0.8.13 - Bump
org.pitest:pitest-mavenfrom1.17.3to1.20.0 - Bump
org.pitest:pitest-junit5-pluginfrom1.2.1to1.2.3 - Bump
org.apache.maven.plugins:maven-gpg-pluginfrom3.2.7to3.2.8 - Bump
org.slf4j:slf4j-nopfrom2.0.16to2.0.17 - Bump
org.slf4j:slf4j-simplefrom2.0.16to2.0.17
v2.7.0
Features
- Add the
PostProcessorconcept to be able to add cleaners or summaries at stamping finish. - #68 Filled to
displayXXXIfpanoply with:displayParagraphIf(boolean),displayParagraphIfPresent(object)anddisplayParagraphIfAbsent(object)displayTableRowIf(boolean),displayTableRowIfPresent(object)anddisplayTableRowIfAbsent(object)displayTableIf(boolean),displayTableIfPresent(object)anddisplayTableIfAbsent(object)displayWordsIf(boolean),displayWordsIfPresent(object)anddisplayWordsIfAbsent(object)displayDocPartIf(boolean),displayDocPartIfPresent(object)anddisplayDocPartIfAbsent(object)
- The two provided evaluation context configurer now include the classic Get Accessor and the Map Accessor, so the object used as context can be much more flexible.
- ie.
${name}can now refer to an objectgetName()method or to a mapget("name")value.
- ie.
Bugfixes
- BREAKING -
Paragraph#getCommentnow returns a Collection instead of an Optional, because one paragraph can have several comments. Fixes a bug when commenting several groups of runs by different comments in a single paragraph. - #69 Office-stamper is now aware of Footnotes and Endnotes, it only cleans orphaned notes with
standardWithPreprocessingconfiguration for now, but probably going to run the stamping as well in future versions. - #510 All
repeatXXXcan now accept Iterable as input
Dependencies
- Bump
org.docx4j:docx4j-corefrom11.5.0to11.5.1 - Bump
org.docx4j:docx4j-JAXB-ReferenceImplfrom11.5.0to11.5.1 - Bump
org.springframework:spring-expressionfrom6.1.14to6.2.1 - Bump
org.springframework:spring-contextfrom6.1.14to6.2.1
Continuous Integration
- Bump
org.junit.jupiter:junit-jupiterfrom5.11.3to5.11.4 - Bump
org.pitest:pitest-mavenfrom1.17.0to1.17.3 - Bump
org.apache.maven.plugins:maven-surefire-pluginfrom3.5.1to3.5.2 - Bump
org.apache.maven.plugins:maven-site-pluginfrom3.20.0to3.21.0 - Bump
org.apache.maven.plugins:maven-project-info-reports-pluginfrom3.7.0to3.8.0 - Bump
org.apache.maven.plugins:maven-surefire-report-pluginfrom3.5.1to3.5.2 - Bump
org.apache.maven.reporting:maven-reporting-execfrom2.0.0-M14to2.0.0 - Bump
org.asciidoctor:asciidoctor-maven-pluginfrom3.1.0to3.1.1 - Bump
org.apache.maven.plugins:maven-javadoc-pluginfrom3.10.1to3.11.2 - Bump
org.apache.maven.plugins:maven-gpg-pluginfrom3.2.5to3.2.7
Refactorings
- Removed the old
ObjectDeleterutility class to use mostlyWmlUtils#removemethod instead. - All Lang info is removed with
standardWithPreprocessingconfiguration now.
Tests
- Create the ObjectContextFactory, and the MapContextFactory to test all use cases with POJO Beans and Map equally.
- Fix a bug in Locale when some test failed
- Move processors-specific test outside the DefaultTest class
- #114 added a test to trace this still unresolved issue.
- Word 2 String now includes comments, endnotes and footnotes
- String 2 Word now includes comments
v2.6.0
Features
- It is now possible to add custom function to the Spel context in a simpler way.
Try using
OfficeStamperConfiguration.addCustomFunctionmethods. - Added the
pro.verron.officestamper.utilspackage to provide useful and common elements for core, preset, test and users. - Deprecated the
Paragraphwrapper now can provide a bit more advanced capability on innerP, don’t recommend callinggetP()anymore.
Dependencies
- MAY BREAK Change java target from
17to21 - Bump
org.springframework:spring-expressionfrom6.1.12to6.1.14 - Bump
org.springframework:spring-contextfrom6.1.12to6.1.14
Continuous Integration
- Removed dependabot analysis
- Bump
org.apache.maven.plugins:maven-gpg-pluginfrom3.2.5to3.2.7 - Bump
org.apache.maven.plugins:maven-javadoc-pluginfrom3.10.0to3.10.1 - Bump
org.apache.maven.plugins:maven-surefire-pluginfrom3.5.0to3.5.1 - Bump
org.apache.maven.reporting:maven-surefire-report-pluginfrom3.5.0to3.5.1 - Bump
org.apache.maven.plugins:maven-site-pluginfrom3.20.0to3.21.0 - Bump
org.apache.maven.plugins:maven-project-info-reports-pluginfrom3.7.0to3.8.0 - Bump
org.apache.maven.plugins:maven-javadoc-pluginfrom3.10.0to3.10.1 - Bump
org.apache.maven.reporting:maven-reporting-execfrom2.0.0-M14to2.0.0 - Bump
org.pitest:pitest-mavenfrom1.16.3to1.17.0 - Bump
org.asciidoctor:asciidoctor-maven-pluginfrom3.0.0to3.1.0 - Bump
org.junit.jupiter:junit-jupiterfrom5.11.0to5.11.3
Refactorings
CommentProcessorwas setup with aP,RandPlaceholdernow receives aProcessorContextinstead.- Cleanup of malformed comments has moved to a
PreProcessorinstead of done on the fly during processing. - Do a step toward treating Comment in the same way as Placeholder.
- Deprecated
CommentProcessorto now be setup with aParagraphthat wraps and provides features around the docx4jP. - Deprecated The
Imagepreset object now deprecategetMaxWidthandgetImageBytes. - BREAK Removed
DocxDocument.commentsPartmethod. - BREAK
DocxPart.streamParagraphsmethod now returns theParagraphwrapper, instead of docx4jP.
v2.5.0
Features
- Add a way to set an ExceptionResolver to Office-stamper, with
OfficeStamperConfiguration#setExceptionResolver(ExceptionResolver)and allows users to handle errors programmatically as was expressed in the old Issue #65- Added an
ExceptionsResolversclass providing default implementations - It deprecates
setFailOnUnresolvedExpression(boolean),unresolvedExpressionsDefaultValue(String),replaceUnresolvedExpressions(boolean)andleaveEmptyOnExpressionError(boolean).
- Added an
Dependencies
- Bumped
org.docx4j:docx4j-corefrom version 11.4.11 to 11.5.0 - Bumped
org.springframework:spring-contextfrom version 6.1.11 to 6.1.12.
Continuous Integration
- Added Renovate settings to improve over dependabot
- Follow best practices for maven-gpg-plugin
- Removed GitHub .devcontainer settings
- Bumped
actions/configure-pagesto v5 - Bumped
org.pitest:pitest-mavento 1.16.3 - Bumped
org.apache.maven.plugins:maven-javadoc-pluginto 3.10.0 - Bumped
org.apache.maven.plugins:maven-gpg-pluginto 3.2.5 - Bumped
org.apache.maven.plugins:maven-site-pluginto 3.20.0 - Bumped
org.apache.maven.plugins:maven-project-info-reports-pluginto 3.7.0 - Bumped
org.junit.jupiter:junit-jupiterto 5.11.0
Tests
- Tests can now differentiate tables with their asciidoc-like representation
- Tests can now differentiate when paragraph style has the
cnfStyleproperty set - Quite a few tests have been remodeled to decrease their verbosity
- Added a regression test for Issue #64
v2.4.0
Features
- Office-stamper can now format all
java.timeobjects directly from standard configuration (issue #411), seeengine/src/test/java/pro/verron/officestamper/test/DateFormatTests.java - Office-stamper can now resolve multiline placeholders (not multi paragraph, just with linebreaks)(issue #422)
- Office-stamper proven can resolve custom function inside comments expressions (issue #56)
- Office-stamper proven can resolve displayParagraphIf inside table with repeatTableRow (issue #52)
v2.3.0
Features
- Office-stamper can now resolve images inside footers and headers (issue #53).
- Added the
DocxParttype to wrap thedocx4j.WordprocessingMLPackageand specify a working subpart. - Breaking Change: Updated references to
WordprocessingMLPackagebyDocxPartin API. A default implementation is provided to support existing implementations, but upgrading to the latest version is recommended. - Breaking Change: The order of resolution has been modified. Please check if you had specific expectations in your custom implementations, though nothing should have broken.
- Added the
Dependencies
- Bumped
org.springframework:spring-expressionandorg.springframework:spring-contextfrom version 6.1.10 to 6.1.11.
Tests
- Added a test for the linebreak replacement feature inside tables.
- Introduced the
makeResourcemethod that allows generating a Word document directly from textual representation. - Removed the
integrationsubfolder in tests and moved its content to the main test folder. - Fixed a configuration error in log level settings for tests.
v2.2.0
Continuous Integration
- Added a new Maven extension for caching the build by @caring-coder in https://github.com/verronpro/office-stamper/pull/389.
