Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
.doc files aren't images. You should try seeing if you can automate LibreOffice Writer or Abiword or something in order to print the documents to PDF. – Broam Aug 2 '12 at 15:53

ImageMagick can't read doc files.

You could try

oowriter -pt pdf your_word_file.doc

which requires you have the libre/openoffice suite installed. Note if you have libreoffice, replace oowriter with lowriter.

See this other answer for a similar question.

According to Broam an alternative invocation is

oowriter -convert-to pdf:writer_pdf_Export doc_file.doc –

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.

share|improve this answer
About what I was going to say - automate oowriter to do it. :) – Broam Aug 2 '12 at 15:53
The magic seems to be oowriter -convert-to pdf:writer_pdf_Export doc_file.doc – Broam Aug 2 '12 at 15:54

You can use Libreoffice as a headless tool to convert docs to pdf:

libreoffice --headless --convert-to pdf *.doc

(Taken from this SO answer)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.