gotenberg: Missing links when converting docx bibliography to PDF
When converting a .docx file that contains a bibliography with links via the /forms/libreoffice/convert endpoint, the links & other information from the bibliography are stripped out.
Opening the same .docx file in LibreOffice will show the links just fine.
Exporting the same .docx file in LibreOffice will also preserve the links in the bibliography.
I have tried different page properties for the conversion, but none of them seem to have any effect on the links in the bibliography.
I’m not 100 % sure this is an issue with Gotenberg, but seeing how the export itself works fine via LibreOffice, it might be an issue with Gotenberg.
Samples
Sample .docx file in question:
references.docx
Converted to .pdf via the demo endpoint:
curl --request POST https://demo.gotenberg.dev/forms/libreoffice/convert --form files=@references.docx -o demo.pdf
results in this .pdf file:
demo.pdf
Opening the .docx file and then exporting it as .pdf through LibreOffice results in this .pdf file:
references_odt.pdf
Screenshots
Screenshot of bibliography in references.docx file:
Screenshot of bibliography in demo.pdf file:
Screenshot of the bibliography in references_odt.pdf file:
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16
Thank you for the quick turn-around! I can confirm that setting this property to
falsenow preserves the links in my document:demo_18.pdf
Thanks for the tests!
I’ll find a way to integrate this flag in my variant of
unoconv.Using unoconv/unoserver results in the same issue, the links are also stripped out from references: unoserver.pdf
It is indeed a problem with
unoconv. I found a related issue here. I can also reproduce it by installingunoconvmyself and then using it to convert the samplereferences.docxfile which will result in a.pdffile that has the links stripped:references_unoconv.pdf
According to the aforementioned issue, removing the
"update-indexes"phase fixes this issue, with a list of changes given in this commit. If I make these changes to my local installation ofunoconv, I also find that the links appear again:references_patched_unoconv.pdf
Unfortunately, I can’t really test if this has any negative side-effects. It is good to know that there’s a workaround available, but I’m not sure how to best apply this workaround to my own version of Gotenberg. Some options are also provided in the aforementioned issue by the way of introducing a feature flag or skipping this step when converting to PDF, since LibreOffice itself can export the bibliography just fine.
Ok, it narrows the issue to https://github.com/gotenberg/unoconverter/blob/main/unoconv. No ETA on resolution though. I plan to refactor this python script somewhere in the futur, but it’s a big project…
Huh, maybe check if there is an option that is checked (or not) that could correspond to one of the CLI parameter?
Installing version
24.8.5.2locally and then exporting the.docxas.pdfstill preserves the links correctly:references_24_8_5_2.pdf