When LibreOffice convert docx to pdf does it convert it to ODF first?

So does LibreOffice do following?

  1. docx => odf => pdf

or it does it directly?

  1. docx => pdf

Thanks,
suising

Whenever you are using --convert-to, It imports the document into its own document model. This is not, strictly speaking, “converting to ODF”, but the document model of LibreOffice modules indeed reflect ODF, so it is kind of conversion to ODF. Then it exports the document model to the chosen format; and in case it’s not the same format, you would get the “truncated” result - only things that could be imported (consider import filter imperfection), represented in the document model (consider “ODF” specifics), and exported (consider export filter imperfection), would be exported.

(The “in case it’s not the same format” clause is to reflect the fact that for some external formats, LibreOffice uses “interoperability grab bags”, allowing it to store some original document’s information, that LibreOffice does not recognize itself, to be exported back when writing to the same external format, trying to increase quality of round-tripping. The truncation would still be there, but the exported document would not only contain what could fit into ODF, but also some original document’s information that happened to go through interop grabbag temporary storage.)

Thanks Mike. Do you think there is advantage to convert the

  1. docx => odf => xhtml => do some automated template filling => pdf.

as compare to

  1. docx => automated template filling => pdf

I don’t know which advantage could you talk about. Using my magic crystal, I can imagine that could be e.g. existing software that can process xhtml for you, which you are experienced with, compared to writing the “automated template filling” using LibreOffice’s own API… or removing stuff that cannot be represented in HTML (that you for some reason don’t need)… or maybe something else. But if you don’t throw any other unknowns into equation, and simply want as close to original a conversion as possible, then any additional conversion step would only make things worse.

Thanks again. Our goal is to generate pdf as close to its original (in docx format).