Edit word files and convert to PDF php

-1

I have a document and every time I need to change information in it I need to do all this procedure that I will explain again, I would like a solution that would make it easy to convert Word to PDF.

Problem: I have a proposal system that has "templates" in Word documents for each proposal that we need to change depending on the proposal, these documents have text images, tables, etc.

Resolution: What I did to solve the problem was to convert Word documents to .odt and then open them with PHP and make replace the strings I want.

The problem I have at the moment is that when there is a change in a document I have to convert again and put all the strings in the right site that takes a long time because the documents have an average of 18 pages.

Does anyone know of any way to change documents faster and more efficiently to generate the PDF of the document.

At first I thought about using the tcpdf library but it would take a lot more time to get everything in the documents to the PDF, the solution I presented was as quick as I could, but it was very time consuming.

    
asked by anonymous 18.09.2014 / 20:21

1 answer

-1
directory=$1
filename=$2
extension=$3
SERVICE='soffice'
if [ "'ps ax|grep -v grep|grep -c $SERVICE'" -lt 1 ]; then 
unset DISPLAY
/usr/bin/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard & 
sleep 5s
fi
python /home/website/python/DocumentConverter.py /home/website/$directory$filename$extension /home/website/$directory$filename.pdf

link

    
18.09.2014 / 21:25