Ask Your Question
0

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

asked 2020-08-23 14:14:06 +0200

suising gravatar image

So does LibreOffice do following?

  1. docx => odf => pdf

or it does it directly?

  1. docx => pdf

Thanks, suising

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2020-08-23 14:56:26 +0200

updated 2020-08-23 15:32:04 +0200

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.)

edit flag offensive delete link more

Comments

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
suising gravatar imagesuising ( 2020-08-23 15:15:41 +0200 )edit
1

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.

Mike Kaganski gravatar imageMike Kaganski ( 2020-08-23 15:23:41 +0200 )edit

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

suising gravatar imagesuising ( 2020-08-23 15:33:45 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-08-23 14:14:06 +0200

Seen: 65 times

Last updated: Aug 23 '20