raunak
raunak

Reputation: 21

printing a doc file using cocoa

I'm looking for a simple code to print the contents of a MS Word file (.doc, .docx) using Cocoa. I'm a newbie to Cocoa. Someone please help.

Upvotes: 2

Views: 846

Answers (1)

Joshua Nozzi
Joshua Nozzi

Reputation: 61228

Mac OS? Doc format is supported by NSAttributedString, which means it can be opened in an NSTextView. You print a doc file the same as you print most other text/rich text files. You can do it with an off-screen text view if you don't want to force the user to view it before printing.

There is some good example code for printing from an off-screen NSTextView on the CocoaDev wiki.

Upvotes: 1

Related Questions