Hi
Thanks for your inquiry. You need to set a license before performing any operations with documents. Make sure you do it before instantiating a Document object. It is only required to set a license once per application or process. So you should set license when your application starts.
For example if your application is simple console application then you should use th following code:
public class Main {
public static void main(String[] args) throws Exception {
//Set license
License lic = new License();
lic.setLicense("Aspose.Words.lic");
//Build document
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
//Here you should build your document
//.....................................
builder.write("Hello world");
//.....................................
doc.save("out.doc");
}
}
Hope this helps.
Best regards.
Alexey Noskov
Developer/Technical Support
Aspose Auckland Team