From 0d941848af0a5c6516b9f85ed26cc353184d2e8c Mon Sep 17 00:00:00 2001 From: "Peter P. Lupo" Date: Fri, 31 Jul 2026 20:25:55 -0400 Subject: [PATCH 1/6] Add --convert-to / --print-to-file CLI flags Handles both before any CEF/Qt UI startup by shelling out to the packaged x2t converter with a minimal TaskQueueDataConvert XML task (only m_sFileFrom/m_sFileTo/m_sAllFontsPath; format is auto-detected from file extensions the same way x2t's own native CLI mode does it). --print-to-file is an alias that forces PDF output, since x2t's PDF export is already what Print ultimately produces, so no CEF-driven print pipeline is needed for either flag. Also adds src/utils.cpp (the InputArgs namespace main.cpp already relies on) to CMakeLists.txt's COMMON_SOURCES, where it was missing. Signed-off-by: Peter P. Lupo --- win-linux/CMakeLists.txt | 3 + win-linux/src/chelp.cpp | 4 +- win-linux/src/docautomation.cpp | 113 ++++++++++++++++++++++++++++++++ win-linux/src/docautomation.h | 38 +++++++++++ win-linux/src/main.cpp | 4 ++ 5 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 win-linux/src/docautomation.cpp create mode 100644 win-linux/src/docautomation.h diff --git a/win-linux/CMakeLists.txt b/win-linux/CMakeLists.txt index b256bacdf..1c5bb5e19 100644 --- a/win-linux/CMakeLists.txt +++ b/win-linux/CMakeLists.txt @@ -162,6 +162,7 @@ set(COMMON_HEADERS src/cascapplicationmanagerwrapper_private.h src/casctabdata.h src/utils.h + src/docautomation.h src/chelp.h src/cfilechecker.h src/clogger.h @@ -182,6 +183,8 @@ set(COMMON_HEADERS set(COMMON_SOURCES src/prop/cmainwindowimpl.cpp src/prop/utils.cpp + src/utils.cpp + src/docautomation.cpp src/windows/cmainwindow.cpp src/windows/cwindowbase.cpp src/windows/ceditorwindow.cpp diff --git a/win-linux/src/chelp.cpp b/win-linux/src/chelp.cpp index c359d240c..67d3b2c16 100644 --- a/win-linux/src/chelp.cpp +++ b/win-linux/src/chelp.cpp @@ -58,7 +58,9 @@ void CHelp::out() " --unlock-portals disable forced hiding of the Connect to the cloud button on the start page" " --updates-appcast-channel=dev set development URL for updates\n" " --updates-interval=