Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

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
1  
About what I was going to say - automate oowriter to do it. :) –  Broam Aug 2 '12 at 15:53
1  
The magic seems to be oowriter -convert-to pdf:writer_pdf_Export doc_file.doc –  Broam Aug 2 '12 at 15:54

Your Answer

 
discard

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.