Skip to content

Accept tracked changes before conversion + jodconverter 4.4.9#3

Open
rychoo2 wants to merge 1 commit into
mainfrom
feature/accept-tracked-changes
Open

Accept tracked changes before conversion + jodconverter 4.4.9#3
rychoo2 wants to merge 1 commit into
mainfrom
feature/accept-tracked-changes

Conversation

@rychoo2

@rychoo2 rychoo2 commented Jul 15, 2026

Copy link
Copy Markdown

Summary

Adds the ability to accept all tracked changes (redlines) before converting a document, so exported PDFs show the clean "final" view rather than insertion/deletion markup. Also bumps jodconverter 4.4.7 → 4.4.9.

By default LibreOffice preserves tracked changes on export, so a docx with revisions can produce a PDF full of change markup. This adds a JODConverter Filter that dispatches .uno:AcceptAllTrackedChanges on the loaded document before it is stored.

Changes

  • AcceptAllTrackedChangesFilter (new) — applies all redlines in-process via .uno:AcceptAllTrackedChanges. Guards on Write.isText(...), so only Writer documents are touched; spreadsheets/presentations pass through untouched. Defensive null checks on context/controller/frame.
  • ConverterController — the filter is wired into the LocalConverter builder only when enabled. Enablement is resolved as: per-request acceptTrackedChanges param if present, otherwise the server default.
  • application.yml — new jodconverter.accept-tracked-changes (env JODCONVERTER_ACCEPT_TRACKED_CHANGES), default false.
  • Versions.ktjodConverter 4.4.7 → 4.4.9.

Behaviour / compatibility

  • Default is false → existing conversions are unchanged (non-breaking).
  • Per request: POST /lool/convert-to/pdf?acceptTrackedChanges=true (works on both the param and /{format} path endpoints).
  • Globally (fits the Draftable deployment): set JODCONVERTER_ACCEPT_TRACKED_CHANGES=true on the converter container — no change needed in the compare service, which posts to a fixed URL.
  • The acceptTrackedChanges param is ignored by ParameterDecoder (doesn't start with its l/lfd/s/sfd prefixes), so it is not mistaken for a load/store property.

Test plan

  • Docker build (./gradlew -x test :samples:spring-boot-rest:build) succeeds
  • docx with tracked changes → pdf with acceptTrackedChanges=true: markup is gone, revisions applied
  • same docx with default (flag omitted, env unset): behaviour unchanged from today
  • JODCONVERTER_ACCEPT_TRACKED_CHANGES=true makes it apply without the request param
  • non-Writer input (e.g. xlsx/pptx) still converts fine (filter no-ops)

Notes

  • No automated test added — exercising the filter requires a running LibreOffice, which the existing lightweight test setup doesn't provide. Verification is manual (above).
  • Independent of the security PR Bump Spring Boot to 3.5.16 to remediate app.war CVEs #2; both only touch adjacent lines in Versions.kt and should merge cleanly.

Made with Cursor

… 4.4.9

Adds an AcceptAllTrackedChangesFilter that applies all redlines in a
Writer document (via the .uno:AcceptAllTrackedChanges dispatch) before it
is exported, so converted PDFs show the clean "final" view instead of
insertion/deletion markup. Non-text documents pass through untouched.

The behaviour is controlled by:
- a per-request `acceptTrackedChanges` parameter on both /lool/convert-to
  endpoints, and
- a server default `jodconverter.accept-tracked-changes`
  (env JODCONVERTER_ACCEPT_TRACKED_CHANGES), defaulting to false so
  existing behaviour is unchanged.

Also bumps jodconverter 4.4.7 -> 4.4.9 (LibreOffice-interop patch releases).

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant