OpenXML SDK 2.0 vs Aspose for server side word 2007 document generation in .NET
Asked Answered
K

4

8

I am going to start a Server side Office automation project in .Net. Below are the key activities that are planned:

  • Create a word document
  • Use a existing word document template having cover page, header, footer, TOC
  • Save file
  • Embed files and resize : HTML, Image, Word, Excel
  • TOC generation and formatting
  • Doc formatting: Page break, Section break, Orientation, Orientation at section break, Continuous page numbering
  • Replace embedded "variables" with use defined contents.

I am more inclined towards OpenXML SDK 2.0 since it is free compared to Aspose. Also, in aspose, I could not locate sample codes to embed Excel document inside word document which is a key requirement.

Can you please guide me on using OpenXML SDK 2.0 or Aspose component? What are the key factors that goes in favor of Aspose (apart from simplicity of APIs) so that i can spend time to evaluate it too?

Thank you.

Kessiah answered 10/6, 2011 at 5:40 Comment(1)
After the docx has been generated, what will consume it? Just Word 2007 or later? This bears on whether you would consider using altChunk (for HTML embedding) and data bound content controls.Maeganmaelstrom
S
11

I just examined both options very carefully for a recent project and can give you the following summary:

OpenXML SDK 2.0

  • Pros

    • It is a solid choice if you want to generate template-based Office documents.

    • Aside from the core SDK there are also the "Productivity Tools for Microsoft Office", which come with a feature called "Reflected Code" to generate the .NET code out of an existing document which actually generates this exact document. Really nice!

    • The SDK is stable and it is supported by Microsoft.

    • It's for free! Aspose.Words costs a pretty penny, especially if you have a large number of developers on your team or would like to use it in a "Software as a Service" environment.

  • Cons

    • OpenXML cannot render office functions. In short this means that the page numbers of a TOC or the actual page numbers of your Word document are not rendered until the user refreshes the document. The same is true for Excel calculations, so you can't do this rendering/calculation on the server-side (WordAutomation here we are again).

      So if you need this feature I would highly recommend you to go with Aspose.Words.
      See this SO question/answer for more details.

    • The learning curve for the SDK seems to be a little bit higher than for Aspose.Words.

You also might have a look into the Word Automation Services in Sharepoint 2010.

Hope that helps!

Semblance answered 29/6, 2011 at 18:43 Comment(0)
S
2

You can also try Docentric, which is OpenXML based toolkit. It requires a license, but it pays off quickly with the time it saves.

You design a template in Word (version 2007 or newer), using all of the Word formatting options (headers, footers, tables, numbering, TOC, subdocuments, conditional formatting, etc). At runtime you can merge data with the template. Data can come from database(s) or xml files.

Have a look at this post for sample application.

Selfdiscipline answered 3/3, 2015 at 19:13 Comment(0)
A
1

You may find the detailed comparison of Aspose.Words for .NET and OpenXML SDK in the following topic: Why not OpenXML SDK?

At answered 8/8, 2011 at 8:2 Comment(1)
"Sponsored by Aspose"...Potency
T
0

If you are open to other alternatives, Windward Reports (disclaimer - I'm the CTO at Windward) fits your needs perfectly. Like Aspose you do have to pay for it. But with Windward what you want would be very easy as you are designing your document in Word.

And yes, 1) It will generate the table of contents in the final document, 2) It can import an Excel worksheet into a generated Word document, 3) You can place any data into the template at runtime, and 4) It supports all of Word's formatting, breaks, etc.

Tjader answered 9/9, 2011 at 15:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.