I’m trying to set up license in Java code. Can someone please help me figure out why it is not working?
I have this code which is supposed to set the license.
InputStream is = openStream("license.lic"); License license = new License(); license.setLicense(is);
I do not get any exception running the above code. After setting the license, I proceed to create the Viewer and feed it with a source PDF file:
HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources(pageFilePathFormat); Viewer viewer = new Viewer("/home/lab/groupdocs/org/test.pdf"); viewer.view(viewOptions);
Still getting no error. I can see that this generates output files in the destination directory, but they all have an copyright note that says “Evaluation Only. Created with Aspose.PDF”.
I also noticed that if I simply remove the code which was supposed to set the license, I still get the same outcome. Does that indicate that the license was not properly validated? Perhaps, am I supposed to pass the License object to ViewerOptions or Viewer ?
More importantly, is there a way to tell whether the issue was with the license itself or with the code not setting the license up correctly?