tags:

views:

185

answers:

3

Hi everybody, I would like to convert pdf, doc files to html files using Cocoa Please help me in this. Thanks in advance,

A: 

hi,

there are a couple of tools for the unix commandline that do such kind of conversions. check out http://pdftohtml.sourceforge.net/ & http://rtf2html.sourceforge.net/

you may see if there are other tools like this.

but to get back to your question. these command line tools can be called from within your cocoa app (won't work on the iphone) and produce the html result.

check out this link for a guide on how to embed such command line tools within your app.

stigi
+2  A: 

You can convert Word files to HTML using NSAttributedString. You can't do this in pure Cocoa for PDF files; you'll have to use a conversion tool, such as stigi suggested. To do that, use NSTask.

Peter Hosey
+2  A: 

Cocoa's PDFKit framework can convert a PDF file to text, through PDFDocument's -string method for example. Of course this won't copy images or formatting though, and it depends on PDFKit being able to recognize text in the file.

Marc Charbonneau