Aspose.Word still shows "Evaluation only" message even after applying the license (for the first conversion into pdf) - java

Hello,

The license is in the src/main/resources directory.

The code does not produce any error, but when I restart the server
weblogic, if the first conversion to the PDF file (converted from Aspose.Words) is a file doc, docx or rtf, Aspose.Words still shows “Evaluation only” message, even after the license.

Here’s is snippet of the code I am using:

/**
* License Aspose
*/
static License license;

if (license == null)
{
    license = new License();
    try
    {
        InputStream isLicense = Thread.currentThread().getContextClassLoader().getResourceAsStream("Aspose.Words.lic");
        license.setLicense(isLicense);
    }
    catch (Exception e)
    {
        logger.error("Erreur sur le chargement de la licence Aspose", e);
    }

}

In summary:
Case A:
When I restart the server weblogic, if the first conversion is a ‘.txt’ file or ‘.Odt’ file + X conversions of any type (txt, doc, odt, …) => the conversion is good without “Evaluation only” message.

Case B:
When I restart the server weblogic, if the first conversion is a ‘.Doc’ file or ‘.Docx’ file or ‘.Rtf’ file + X conversions of any type (txt, doc, odt, …) => the first conversion has in the header the “Evaluation only” message.

Have you ever encountered this anomaly?
Could you tell me what am I doing wrong?

The Evaluation message is “Evaluation Only. Created with Aspose.Words. Copyright 2003-2010 Aspose Pty Ltd.

Thanks in advance.

Cyril BOUTTEVILLE

Hi Cyril,

Thanks for your inquiry. I would suggest you please use the same approach as suggested by following documentation here:

https://docs.aspose.com/words/java/licensing/
https://docs.aspose.com/words/java/licensing/

please feel free to ask, if we can help you with anything else.

Best Regards,

Hi Imran Rafique,

My problem is resolved.

In this documentation : https://docs.aspose.com/words/java/licensing/,
it is write “Make sure you do this before creating a Document object”.
It’s exact.

My code before :

Document doc = new Document(new ByteArrayInputStream(documentBinaire));
setLicenseAspose();
setFontFolders();

My code after :

setLicenseAspose();
setFontFolders();
Document doc = new Document(new ByteArrayInputStream(documentBinaire));

And it’s good.

Thanks,

Cyril BOUTTEVILLE

Hi Cyril,

It is great that you managed to implement what you require. Please feel free to ask in case of any issue.

Best Regards,