Free Support Forum -

Help - trying to try out Aspose.Word

I’ve downloaded the component to try it out. I just need to be able to open an existing word doc after it’s uploaded from an form and insert some dynamic text at the top and save. Aspose seems overkill for this purpose but I can’t find any other suitable component. Can it do this? Thanks.

Also, what version of the component would I need? Just needs to work for a single site.


Aspose.Word can certainly help and it is true, there are not many other components can do this.

I would appreciate you explain why you think Aspose.Word is an overkill for this? Do you find licensing options too complex or the component itself?

Look at Aspose.Word documentation. Main methods and classes have reasonably detailed descriptions and examples.

Basically your code should look like this:

//Open the uploaded document.
Word word = new Word();
Document doc = word.Open(stream or fileName);

//Create a document builder object for the document (concept similar to StringBuilder in .NET)
DocumentBuilder builder = new DocumentBuilder(doc);

//The “cursor” is already position at the beginning of the document, but you can
//move it using several DocumentBuilder.MoveToXXX methods.

//Use DocumentBuilder.Font and many other properties to specify formatting.
builder.Font.Size = 14;
builder.Font.Name = “Arial”;

//Use DocumentBuilder.Writeln, Write, or InsertXXX methods to insert content.
builder.Writeln(“My text”);

//Save the file
doc.Save(fileName or stream);

As a minimum you need Standard Edition because it allows to work with DocumentBuilder. If you documents contain some advanced elements such as images, nested fields, headers and footers you need Professional Edition. There are some more options, you can see in Edition Types.

You can start by buying minimal license and it is easy to upgrade to better license if needed. You just pay the difference in price.

For a single site you need all the default purchase options:
One Development Machine, Web Platform, One Domain Name.

Better yet, build a complete solution using the evaluation version. It does not expire - just inserts a watermark. Make sure it all works fine and buy then.

Thank you. I was creating the object incorrectly which is why I thought I needed a license file. I did create a test similar to above and works great. I meant overkill because this particular application just needs to insert an auto generated number into uploaded documents as they come in and Aspose.Word is pretty feature rich for what we’re trying to accomplish. I will be recommending this component as the only option besides them having to manually download and edit. Thanks.