tiwater.convert.cli 0.9.42

dotnet tool install --global tiwater.convert.cli --version 0.9.42
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local tiwater.convert.cli --version 0.9.42
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=tiwater.convert.cli&version=0.9.42
                    
nuke :add-package tiwater.convert.cli --version 0.9.42
                    

tiwater-convert

A generic CLI for loss-aware office format conversion.

Initial scope

  • .xls → .xlsx
  • Writer documents → .pdf through WPS RPC when available
  • XLS/XLSX workbooks → .pdf through ET RPC when available
  • PPT/PPTX/ODP presentations → .pdf through WPP RPC when available
  • Other Office formats → .pdf through a local LibreOffice/soffice install

Usage

tiwater-convert xls-to-xlsx <input.xls> <output.xlsx>
tiwater-convert recalculate-xlsx <input.xlsx> <output.xlsx>
tiwater-convert refresh-docx-fields <input.docx> <output.docx> [--exclude-caption-headings]
tiwater-convert docx-to-pdf <input.docx> <output.pdf>
tiwater-convert xlsx-to-pdf <input.xlsx> <output.pdf>
tiwater-convert pptx-to-pdf <input.pptx> <output.pdf>

recalculate-xlsx treats the input workbook package as authoritative and imports only ET-refreshed cached values and result types for the unchanged formula-cell inventory. It fails closed if ET adds, removes, or changes a formula, and it preserves non-calculation workbook semantics such as fonts and styles.

refresh-docx-fields opens the current DOCX in WPS Writer, refreshes every table of contents and table of figures, and repaginates the document. The distinct output imports only those refreshed index results and their referenced internal bookmarks into the input package; unrelated body content and package parts remain input-authoritative. Its JSON receipt conforms to tiwater.convert-refresh-docx-fields/v1 and binds the input and output bytes by SHA-256. It fails closed when native WPS Writer is unavailable; no auxiliary renderer is accepted for this layout-dependent operation.

--exclude-caption-headings explicitly assigns body outline level to paragraphs whose SEQ label is selected by a table-of-figures TOC field before refreshing. This keeps those captions in the table of figures and excludes them from heading-based contents; caption text, sequence fields, styles and other paragraphs are preserved. The default refresh retains source outline levels. The receipt records exclude_caption_headings.

Successful native WPS PDF conversions include native_render_provenance conforming to tiwater.convert-native-render-provenance/v1. The provider records the WPS package build and executable hash, OS/.NET runtime identity, a count/hash-only fontconfig inventory based on font family, style, and font bytes, input/output SHA-256 identities, and PDF page count. Native conversion fails closed when any required provenance cannot be collected. Consumers should retain this provider-owned object unchanged rather than probing the host independently.

XLS conversion prefers ET through pywpsrpc when available, because WPS generally preserves legacy workbook formatting better on Linux. Set TIWATER_WPSRPC_PYTHON to the pywpsrpc venv Python if it is not installed at ~/.local/share/tiwater/wpsrpc-venv/bin/python. xvfb-run and the WPS et command must be available. If WPS conversion is not available or fails, the converter falls back to LibreOffice/soffice and then to the built-in NPOI converter.

DOC, DOCX, ODT, and RTF PDF conversion prefers WPS through pywpsrpc when wps, xvfb-run, dbus-run-session, and the configured WPS RPC Python are available. The converter launches WPS with an isolated D-Bus session and writable per-conversion XDG cache/runtime directories so it remains usable from restricted automation sandboxes. The JSON result records backend: "wps" or backend: "libreoffice" and a fallback reason. Set TIWATER_OFFICE_PDF_BACKEND=wps to require the native WPS backend and fail closed when it is unavailable; use libreoffice to request the auxiliary backend explicitly.

XLS and XLSX PDF conversion likewise prefers ET through pywpsrpc when et, xvfb-run, dbus-run-session, and the configured RPC Python are available. Set TIWATER_OFFICE_PDF_BACKEND=et to require that native backend and fail closed; it never treats LibreOffice output as ET proof.

PPT, PPTX, and ODP PDF conversion prefers WPP through pywpsrpc when wpp, xvfb-run, dbus-run-session, and the configured RPC Python are available. Set TIWATER_OFFICE_PDF_BACKEND=wpp to require that native backend and fail closed; it never treats LibreOffice output as WPS Presentation proof.

On macOS, set TIWATER_WPS_OFFICE_LIMA_INSTANCE to the name of a configured Lima Linux instance that exposes the documented /tmp/tiwater-wps-render shared directory and has the published WPS, Spreadsheets, and Presentation runtimes installed. The converter then stages each input and output in a unique shared directory and invokes limactl shell <instance> itself; it reports the requested wps or et, or wpp backend and fails closed if the configured instance cannot render. This is an explicit runtime configuration, not an arbitrary command hook.

LibreOffice-backed PDF conversion requires soffice. If it is not on PATH, set one of:

  • TIWATER_SOFFICE
  • SOFFICE
  • LIBREOFFICE_PATH
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.9.42 0 11/23/2026
0.9.41 250 10/7/2026
0.9.40 138 9/14/2026
0.9.39 113 9/14/2026
0.9.38 126 9/14/2026
0.9.37 140 9/9/2026
0.9.36 147 9/8/2026
0.9.35 120 9/7/2026
0.9.34 151 9/6/2026
0.9.33 138 9/5/2026
0.9.32 170 9/3/2026
0.9.31 150 9/2/2026
0.9.30 125 9/2/2026
0.9.29 126 9/2/2026
0.9.28 173 8/31/2026
0.9.27 222 8/26/2026
0.9.26 127 8/26/2026
0.9.25 140 8/25/2026
0.9.24 141 8/24/2026
0.9.23 135 8/24/2026
Loading failed