Nayana Adassuriya
Nayana Adassuriya

Reputation: 24766

How Print MS Office document without office installed

My C# Windows application needs to print office documents silently(without popup dialog or open up applications such as Word, Excel ). So I'm trying to find a way to print office documents without office (Otherwise user needs to buy office package also to use my application).

  1. I tried with Aspose.NET but It seems some parts of the documents(such as notes, comments) are getting ignored by this component.
  2. I've also tried to go through Microsoft Office 2010: Primary Interop Assemblies Redistributable. But, as I found to use MS office PIAs, MS office needs to be install in the target computer.

Any ideas where should I look into?

Upvotes: 0

Views: 2962

Answers (2)

Jason R. Mick
Jason R. Mick

Reputation: 5287

Depending on the application, your best bet might be saving the content to Open XML and parsing it (beware there's a lot of bloat in larger documents saved in that format per my experience) or simply saving to PDF.

Another clunkier, but more standalone possibility is to use control.click and such to build an automated clicker that opens content in an external freeware application and prints it. The most compelling option is Microsoft's "Viewer" applications (when available). When that is unavailable for a particular document type, Microsoft suggests OneDrive as a freeware alternative (requires account, internet connection).

If you don't want to use a third party application, that could give you a creative, if clunky route to accomplishing your posted goal. Good luck!

Upvotes: 0

Felini
Felini

Reputation: 455

First you should understand, that MSOffice uses a proprietary format, that event he best open-source office software is having problems reading without screwing something up.

My suggestion is - you either take something that does a minimal amount of damage, or require office. One suggestion would be: Microsoft used to make "word reader" and "excel reader", try to see if they are still being released.

Another idea would be to find a free office-to-pdf or office-to-xps conversion software, include it with your program and print.

The most difficult way, in my oppinion, would be to feed the document to some online service, for example skydrive's document reader, and request it to print the file.

Upvotes: 0

Related Questions