Save as FODT - different pagination between GUI and headless

Hi,

I’ve noticed the following discrepancy. Whenever I save an ODT document as FODT through the GUI, the resulting file has soft-page-break markers matching the original rendered pagination of the ODT document. However, when I do the same using the headless CLI with --convert-to, the pagination is different and sometimes completely missing. Interestingly, both output files have meta:page-count="3" attribute meaning that also the CLI is aware of the pages.

Any ideas how to produce matching results with these two methods?

I’m using LibreOffice 25.8.3.2 but have noticed the same also with 24.8.7.2.

Steps to reproduce using sample.odt (9.4 KB):

  1. Open the document with LibreOffice
  2. “File” → “Save as” → “.fodt”
  3. Open the produced .fodt file with text editor and find 2 <text:soft-page-break/> tags (3 pages in the original document)
  4. Run `libreoffice --convert-to fodt /sample.odt
  5. Open produced .fodt file and find 0 soft page break tags

BR,
Hen

No. The value comes from the ODT; and if you manually edit its meta.xml, and set page number to 30, that will happily appear in the generated FODT.

In general, --export-to doesn’t wait for layout to finish. Given that you wrote " with --convert-to , the pagination is different and sometimes completely missing", I assume, that you find cases when there are soft-page-breaks - so likely, the layout process at least starts (does it?). But waiting for it to finish would not only make it much slower, but also make it subject to some bugs where infinite layout loops prevent documents from opening successfully, but currently may be converted OK.