Since LibreOffice v.7.4, there is a way to pass any filter option available for PDF export, from the command line [1], [2]. The commit that enabled that was 0c3b8792b712e939d2ad524d554f96616b4844be. Currently there is no way to pass e.g. dimensions, or resolution, or other parameters to the graphic export (PNG/JPEG/etc.) from the command line, because a command line like > soffice --convert-to png:writer_png_Export:params_here example.odt will pass the string "params_here" into the respective filter inside a property called "FilterOptions", while the filter only uses a property named "FilterData", which must be a sequence of beans::PropertyValue. See GraphicExportFilter::gatherProperties. The idea is to implement a similar processing of FilterOptions in the gatherProperties, as implemented in the abovementioned commit for PDF. The syntax of the passed parameters should be the same as for the PDF, i.e. a JSON structure like > soffice --convert-to 'png:writer_png_Export:{"PixelWidth":{"type":"long","value":"200"},"PixelHeight":{"type":"long","value":"100"}}' example.odt [1] https://vmiklos.hu/blog/pdf-convert-to.html [2] https://help.libreoffice.org/latest/en-US/text/shared/guide/pdf_params.html?DbPAR=SHARED
useful enhancement, +1
I upload commit https://gerrit.libreoffice.org/c/core/+/186287 with upgrade to allow to pass parameters to graphic export filters.
Oscar Megía López committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/323598a6845bd8b4046689816a7d535385c23a19 tdf#157668 Upgrade to pass options to --convert-to It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Oscar: feel free to change the status as resolved fixed.