Bug 65725 - FILE_SAVE : Master document export PDF in headless mode doesn't show sub documents page
Summary: FILE_SAVE : Master document export PDF in headless mode doesn't show sub docu...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Not Assigned
Keywords: filter:pdf
Depends on:
Blocks: Commandline PDF-Export Writer-Master-Doc
  Show dependency treegraph
Reported: 2013-06-13 18:17 UTC by Arnaud Versini
Modified: 2024-03-07 14:53 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:

testcase (13.98 KB, application/gzip)
2013-07-04 19:35 UTC, Jorendc

Note You need to log in before you can comment on or make changes to this bug.
Description Arnaud Versini 2013-06-13 18:17:25 UTC
Creta a master document with few pages
Add sub documents with pages
Export soffice --headless --convert-to in command line

Expected behavior : the PDF contains all pages
Result : The PDF contains only contains master document pages
Comment 1 Jorendc 2013-07-04 19:33:26 UTC
I think I can reproduce this bug: converting a 5 page containing odm-file (master document) result in a PDF containing 1 blank page.

Tested using Linux Mint 15 x64 with LibreOffice RC.

Kind regards,
Comment 2 Jorendc 2013-07-04 19:35:40 UTC
Created attachment 82041 [details]

This contains 2 documents (1.odt and 2.odt) and 1 master document containing those 2 documents.

* Unpack file
* open terminal
* cd to unpacked folder
* convert headless using: soffice --headless --convert-to PDF masterdoc.odm 

Kind regards,
Comment 3 Jean-Baptiste Faure 2013-07-13 17:08:28 UTC
I reproduce the problem with Version: (Build ID: 6089121ebd075bb6422d33d6bff69dff2e88efb) even if I configure Writer to automatically update the links on opening the file (it seems this option depends on the file).

Best regards. JBF
Comment 4 QA Administrators 2015-04-01 14:42:16 UTC Comment hidden (obsolete)
Comment 5 Jean-Baptiste Faure 2015-04-12 07:30:17 UTC Comment hidden (obsolete)
Comment 6 Emmanuel DUMAS 2016-04-08 08:23:23 UTC
Still reproducible on Ubuntu 15.10.

$ libreoffice --version
LibreOffice 00m0(Build:2)

Exact command :
libreoffice --headless --convert-to pdf --outdir ~/tmp ./XXXXXX.odm

Is-there any tips (script ? intermediate result ?) to avoid this bugs ?
Comment 7 rockorequin 2017-03-15 02:37:04 UTC
This bug is still present in LibreOffice 5.3.0~rc3.

You might be able to do the conversion using unoconv (I'm using v0.7-1.1). unoconv used to suffer from this bug, but it seems to be importing the subdocs correctly when converting to pdf now. (When it used to have the same bug, I used to make unoconv convert the master document to ott first and then to pdf. But now unoconv just converts the master document to a master document with an ott extension if you ask it to do this.) 

I can't use unoconv to convert my master documents, though, because I have a program insert text into the subdocuments, and unoconv doesn't repaginate anymore when doing the conversion so the extra text gets all bunched up at the bottom of the page and is unreadable. So it would be great if soffice could correctly import the subdocs when doing the conversion.
Comment 8 rockorequin 2017-03-15 04:59:53 UTC
I think the bug might actually be in the import filter, because the same bug occurs when converting a master document to a ODT (flat) document - the resulting ODT contains none of the subdocuments.

Re the workaround, unoconv 0.7-1.1 with LibreOffice 5.1 does convert the master document correctly to a PDF, including repagination. "unoconv -f pdf --output=<output file and/or directory> <input filename>" is the command to use.
Comment 9 rockorequin 2017-08-31 06:43:44 UTC Comment hidden (obsolete)
Comment 10 QA Administrators 2018-09-01 02:41:58 UTC Comment hidden (obsolete)
Comment 11 Jean-Baptiste Faure 2018-09-15 20:37:54 UTC
Still reproducible with LibreOffice built at home under Ubuntu 18.04

Best regards. JBF
Comment 12 QA Administrators 2019-09-16 02:46:40 UTC Comment hidden (obsolete)
Comment 13 Derek Cooper 2020-07-26 19:13:29 UTC
I can confirm this bug exists in version on Windows 10.

Version: (x64)
Build ID: a726b36747cf2001e06b58ad5db1aa3a9a1872d6
CPU threads: 8; OS: Windows 10.0 Build 18363; UI render: default; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Comment 14 rockorequin 2020-08-24 05:45:38 UTC
This bug is also still present in Linux in LibreOffice 40(Build:2), and unoconv no longer works either, so soffice has now introduced this bug to whichever path unoconv was using and there is now no workaround.

I note that in the GUI mode, Writer always asks whether I want to import the linked docs. So I tried setting Writer to automatically import linked docs (Tools / Options / LibreOffice Writer / General - Update links when loading) and because this setting doesn't work in the GUI, I also set my filesystem to be trusted by adding it to Tools / Options / LibreOfice / Security - Macro Security | Trusted Sources - Trusted File Locations. The automatic update then worked in the GUI, but it has no effect on headless mode.

How do you go about getting a 7-year-old bug investigated in LibreOffice? It's obviously not hard to reproduce this bug.
Comment 15 QA Administrators 2022-08-25 03:43:51 UTC Comment hidden (obsolete)
Comment 16 Talmid 2024-03-07 14:53:35 UTC
It is not fixed in version LibreOffice 30(Build:2)

I run the command: libreoffice --headless --convert-to pdf booklet.odm

And the result is an empty pdf.