Convert to PDF via command line: Default "InitialView" value?

I’m trying to convert office documents (.docx, .xlsx, etc.) to PDF via command line, using LibreOffice 24.2.7.2 installed from ubuntu’s official repo.

For example I can do it simply by

libreoffice --convert-to pdf input.docx

What I’m confused about is the “InitialView” setting.
According to the official document, the default value of “InitialView” is “0”. However, it looks like the actual default value is “1”. So if I want to hide the side pane I have to set the value (and the PDF filter) explicitly like

libreoffice --convert-to 'pdf:writer_pdf_Export:{"InitialView":{"type":"long","value":"0"}}' input.docx

, which is a bit complicated.

Is this just a bug, or am I missing something?

You checked the contents of your pdf, or interpret the behaviour of your (unknown) pdf-viewer?

yep. here too : API/Tutorials/PDF export - Apache OpenOffice Wiki
(ref from https://gerrit.libreoffice.org/c/help/+/150797147105 – Document the various new PDF export options in command-line)

indeed, Common.xcs (revision 3a5c9f31b662519293120f3e10d1b555e1f14849) - OpenGrok cross reference for /core/officecfg/registry/schema/org/openoffice/Office/Common.xcs

(from InitialView (full) in projects: core - OpenGrok search results)

How to Report Bugs in LibreOffice - The Document Foundation Wiki

Sorry, I should have written my situation with more details.

I first noticed that when I open PDF files (created by the simple conversion command) by Adobe Reader they had side pane, which I usually don’t see, so I checked the files by PDF-XChange Editor and ExifTools.

According to ExifTools, a PDF file created by

libreoffice --convert-to 'pdf:writer_pdf_Export:{"InitialView":{"type":"long","value":"1"}}' input.docx

has a property Page Mode: UseOutlines.

A PDF file created by

libreoffice --convert-to 'pdf:writer_pdf_Export:{"InitialView":{"type":"long","value":"2"}}' input.docx

has a property Page Mode: UseThumbs.

A PDF file created by

libreoffice --convert-to 'pdf:writer_pdf_Export:{"InitialView":{"type":"long","value":"0"}}' input.docx

does not have Page Mode property.

Then, a PDF file created by

libreoffice --convert-to pdf input.docx

has a property Page Mode: UseOutlines.
So I thought it looked like the default value of “InitialView” was “1”.

No, but without the explicit settings in the command line, the conversion uses the settings configured in the UI. Which should likely be mentioned in the documentation.

the conversion uses the settings configured in the UI

Hmm, I’m running my LibreOffice in Ubuntu Server 24.04.2, so I have never launched the GUI. Do I have to set LibreOffice’s default InitialView setting somewhere?

You don’t have to. But please follow the suggestion to file the bug reports.

Likely, you think that 0 means something specific - why do you write ‘it looks like the actual default value is “1”’? You see something that you interpret as not fitting to the expectation of the value 0.

Maybe it’s the wording of the InitialView option:

neither outlines nor thumbnails

which could be interpreted as the statement that outlines and thumbnails must be turned off? Yes, the wording is confused. It is meant to tell you that those panels aren’t requested to be open - but they aren’t forced closed. “Default” means “whatever the viewer decides”.

The issues are:

  1. The unclear documentation wording;
  2. No value to mean “both closed” (which is technically possible, and /PageMode/UseNone can be written in PDFWriterImpl::emitCatalog - but the parsing of user options doesn’t allow to pass anything else).

You are welcome to file two bug reports.