I want to convert .DOC files into .PDF format using php image library imagemagick . When I used
convert filename.doc filename.pdf
command in terminal to convert file to .PDF format I got the error
convert: no decode delegate for this image format `ATTENDANCE.doc' @ error/constitute.c/ReadImage/532.
convert: missing an image filename `ATTENDANCE.pdf' @ error/convert.c/ConvertImageCommand/3011.
Any help and suggestions will be appreciable.
ImageMagick can't read doc files.
You could try
which requires you have the libre/openoffice suite installed. Note if you have libreoffice, replace
oowriter
withlowriter
.See this other answer for a similar question.
According to Broam an alternative invocation is
though I haven't tested this.
Web service
Alternatively I would also suggest using Google docs (now integrated into Google drive) as an alternative if you have a Google account or don't mind making one.
You can upload the doc and it will convert it to pdf for you (or an openoffice format if you prefer).
Which one should you use?
Of these two options, the last time I checked Google docs had a higher conversion fidelity.
You can use Libreoffice as a headless tool to convert docs to pdf:
(Taken from this SO answer)