I am trying to convert a PDF file to docx using command line using:
soffice --infilter=“writer_pdf_import” --convert-to “docx:MS Word 2007 XML” *.pdf
The Input PDF contains multiple pages. The Output Docx file when opened has the contents of the pages over written onto one another into a single page. Hence, the number of pages in the Docx file is only 1.
Section of the document is shown in the Image below.
I expect each page on PDF written to corrosponding page in Docx.
Additional Info:
Version: LibreOffice 7.5.4.2 36ccfdc35048b057fd9854c757a8b67ec53977b6
OS: Windows
I had the same problem with Libreoffice 7.5.2.2 and 7.5.5.2.
Solved by uninstalling Libreoffice 7 and installing LibreOffice 6.4.7.2. This command now works wihtout collapsing:
soffice --convert-to "docx:MS Word 2007 XML" "source_path_to.pdf" --outdir target_folder --infilter="writer_pdf_import" --headless