Reputation: 73
I am using PHP as a backend end, I generate a Docx
file on the backend and I want to send it to the frontend to make the user print it directly without downloading it.
So I wanted to convert the Docx
file to PDF
and put it on the server so I can send its link to the frontend to make the user able to view it and print it.
But I am not able to convert from Docx
to pdf
, can anyone tell me an easy way to convert from Docx
to pdf
, or if anyone has an alternative way to do the whole process.
I am using PHPWord
to generate the Docx
files from templates.
Attempts:
a) I tried to use PHPWord
to convert the Docx
file to an HTML
file but it generates a blank file.
b) I tried to use COM
with OpenOffice
but the following error appeared:
HTTP Error 500.0 - Internal Server Error. C:\php\php-cgi.exe - The FastCGI process exceeded configured request timeout
c) I tried to use COM with Word.application
, but I received Access denied.
Note: I am a beginner at PHP.
Upvotes: 1
Views: 914
Reputation: 628
You have a couple of choices:
Also, you can check this article and build it on top of Azure serverless.
Upvotes: 1