A
A
alikhandro2021-06-04 08:01:45
Laravel
alikhandro, 2021-06-04 08:01:45

How to convert docx to pdf (php laravel)?

I generate certificates from docx files from the admin panel, the admin loads the template from the docx file, and the service replaces some words there with an automatic machine, and first saves the finished docx file for PDF conversion. up to this point, everything works perfectly, then when I convert to pdf, then 4-5 pages are formed from one docx page (photo size changes, content jumps, etc.
I tried to install gearpdf (it didn’t work because of a version conflict).
I tried to change font (failed)
At the same time, all the paragraphs are gone, the size and location of the photo are different, and instead of the text that was replaced using setValue, there are ??????????????? such signs (although the text is completely in English).

How to convert from docx to pdf without changing anything?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2021-06-04
@2ord

Try Apache Office/Libreoffice. If the quality of the conversion suits, then
soffice --headless --convert-to pdf somefile.docx
soffice or libreoffice have the same arguments.
Other options: Apache POI, pandoc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question