What is the purpose of setting Aspose License in Java

Hi Team,

I would like to know , what is purpose of setting license in java as below

com.aspose.words.License license = new com.aspose.words.License();
license.setLicense(new java.io.FileInputStream("Aspose.Words.Java.lic"));

I am not seeing any difference in output result even If remove above 2 lines from my code. So what is the use of license? In which cases license is required, please give an example.

I am successfully able to convert my HTML of 5000 lines into PDF or DOCX without license then why should I buy new license?

Thanks
Ramesh

@ramesh676 Aspose.Words in evaluation mode injects an evaluation watermark into the document and limits the maximum size of the processed document to several hundreds of paragraphs. Please see our documentation for more information:
https://docs.aspose.com/words/java/licensing/

If you do not see these limitation without applying license, there might be two reasons either you are using a cracked version of Aspose.Words or the license is applied somewhere else in your code. Could you please attach Aspose.Words JAR used on your side?

Hi @alexey.noskov,

I have downloaded aspose.words jar from aspose repo Aspose Repository Browser /java/repo/

I am not using cracked version and I am not seeing any watermark either. Pls find below snip of HTML to PDF converted doc with no watermark

image.png (139.3 KB)
Could you show me some sample with evaluation watermark injected in the document??

@ramesh676 Here is PDF document produced by the following code without applying the license:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Hello, World!!!");
doc.save("C:\\Temp\\out.pdf");

out.pdf (51.0 KB)

Hi @alexey.noskov,

Could you please share me the out.pdf with license added. I would like to see how the out.pdf will be if I add license in same java file.

Thanks

@ramesh676 Sure, here is PDF document produced by the same code with the license applied:
out.pdf (16.8 KB)

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertHtml(html);
doc.save(docOutStream, SaveFormat.PDF);

html is a string of html. I am using above and I have commentated my license setup part as below even tough I am able to generate pdf without watermark, PFA.PdfGeneratedWithoutLicense.pdf (62.8 KB)

//Path licenseFileName = Paths.get("C:\\Users\\Ramesh\\Downloads", "Aspose.TotalforJava.lic");
//	License license = new License();
//	license.setLicense(licenseFileName.toString());

I am not at all setting up license and why watermark is not getting generated in output?

@ramesh676 Unfortunately, it is difficult to say what the problem is, since I cannot reproduce it on my side. I can only guess that the license is applied somewhere in your application before you run the above code. Please try the following code to remove the applied license and check whether evaluation message and watermark are added into the output document:

// This removes the applied license
com.aspose.words.License lic = new com.aspose.words.License();
lic.setLicense("");
        
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Hello, World!!!");
doc.save("C:\\Temp\\out.pdf");

Thanks @alexey.noskov.

Now I got clarification. I tried below code

com.aspose.words.License lic = new com.aspose.words.License();
lic.setLicense("");

After using above code I am getting that evaluation watermark. The issue was with Downloading from AsposeJavaAPI: https://releases.aspose.com/java/repo/com/ey/eypoc.core/maven-metadata.xml

When I used license first time then my details were updated in maven-metadata.xml that I am licensed user. When I removed the license then it again updated maven-metadata.xml file that I am not licensed user and this is what the issue.

Thanks for your help @alexey.noskov !! We can buy a original license now.

Thanks
Ramesh

@ramesh676 It is perfect that you managed to fond the reason of the problem. Please feel free to ask in case of any further issues. We are always glad to help you.

Hi @alexey.noskov,

I have a img reference as below in my html

img src="https://www.tutorialspoint.com/assets/questions/media/426142-1668760872.png" alt="alternatetext"

I am converting this html to docx format . When I open generated docx file I am seeing the broken image in my output docx file as below.

image.png (1.3 KB)

May I know how can I make the image that is in HTML should render in output.docx file??

Thanks

@ramesh676 The question is answered in another your thread:
https://forum.aspose.com/t/render-images-present/270503/3

Hi @alexey.noskov

I have one query regarding license, If I buy aspose.words for java , can I convert my html to pdf , docx and txt formats?

Thanks

@ramesh676 Sure, you can convert your document to PDF, DOCX, TXT and other formats supported by Aspose.Words. Please see our documentation to learn what formats are supported by Aspose.Words:
https://docs.aspose.com/words/java/supported-document-formats/