Search code examples
pdfdata-conversionlibreofficeodt

How to convert a "pdf" to "odg" file with OpenOffice cmd


I can easily convert a pdf to an odt file using:

soffice --infilter="writer_pdf_import" --convert-to odt a.pdf

But when I try to do:

soffice --infilter="writer_pdf_import" --convert-to odg a.pdf

I get an error:

no export filter


Solution

  • TL;DR the answer is at the bottom but do read the following as to why there can be issues

    ODG is a multi-part graphics file usually a blank template, often similar to an ORA, however there are many ways they can be structured and converted TO a set of PDF page printouts, as they contain thumbnails, plus one or more high resolution images or scalable vector graphics. Common variants can be used with Inkscape, Krita possibly Scribus / OODraw and other more GRAPHIC apps.

    enter image description here

    PDF is a page document output format thus not a suitable candidate for converting to professional images with scalar graphics. *Except see the last comment

    ODG or ORA may be done well in image conversion but the reverse is not usually true.

    Open Office Graphic is like a DocX, a zip wrapper around a core object, here it is a Jpeg but could be PNG SVG etc.

    enter image description here

    However the contents of the zip are not simple potentially running to thousands of lines of coding. Thus you need to use a more appropriate method to hand build an ODG not simple command line conversion from cruder PDF.

    enter image description here

    The real strength of a EXPORT from draw as PDF is the hybrid use of embedding ODFG content thus opening such a PDF you can edit it in Draw.

    enter image description here

    And it will look just as good in any PDF viewer. However it is too specialist to be simply translated without the app settings. In reality the PDF is the chimera/polyglot ODG.

    enter image description here

    But if you wish to try with simple files the command line is for a.pdf to a.odg

    soffice --infilter="draw_pdf_import" --convert-to odg a.pdf

    enter image description here