Evaluation message still showing on converted document after license applied


#1

I’m not sure what the problem might be in this case, but running this code does not remove the evaluation message from the generated document:


License: Aspose Total for Java

Document doc = null;
com.aspose.pdf.Document docPDF = null;
String newFile = null;
try {
lic = getLicense(licFileName);
doc= new Document(docPath.getAbsolutePath());
if (com.aspose.pdf.Document.isLicensed()) {
System.out.println(“License OK”); // console shows ‘License OK’
}
else {
System.out.println(“No License found”);
}
}
} catch (Exception e){
return “-4 Error opening document " + e.getMessage();
}
// Save the document in PDF format.
newFile = docPath.getAbsolutePath().replace(currentExt,”.pdf");
doc.save(newFile); // new file contains the Evaluation message.
public static com.aspose.pdf.License getLicense(String licFile) {
// Create license object
lic= new com.aspose.pdf.License();
try
{
// Specify the path of license file
lic.setLicense(licFile);
}
catch (Exception e)
{
e.printStackTrace();
}
return lic;
}

Would appreciate any hint as to what is wrong with this code.

Thanks,

Francisco



#2

Hi Francisco,


Thanks for contacting support.

Can you please share which version of API you are using and if possible, please share the license file so that we can test the scenario in our environment.

Please follow the instructions specified over following link for information on How to send a license?

We are sorry for this inconvenience.

#3

Hi Francisco,


Thanks for sharing the license file.

I have tested the scenario using Aspose.Pdf for Java 10.1.0 in Eclipse Juno application running over Windows 7 (x64) with JDK 1.7 and I am unable to notice any issue. As per my observations, the license is properly being initialized when converting PDF file to TIFF image. Can you please share some details regarding your working environment.

In an other attempt, I tried using following code snippet to create the PDF file and as per my observations, the license is properly being initialized and resultant file does not contain any evaluation watermark.

[Java]

Document doc = null; <o:p></o:p>

String newFile = null;

try {

com.aspose.pdf.License lic = getLicense("E:\\Package\\file\\Aspose.Total for Java\\Aspose.Total.Java_13Mar2016.lic");

doc= new Document();

if (com.aspose.pdf.Document.isLicensed()) {

System.out.println("License OK"); // console shows 'License OK'

}

else {

System.out.println("No License found");

}

}

catch (Exception e){

System.out.println(e.getMessage());

}

// Save the document in PDF format.

doc.getPages().add().getParagraphs().add(new com.aspose.pdf.TextFragment("Testing document..."));

doc.save("c:/pdftest/LicenseTest.pdf"); // new file contains the Evaluation message.

public static com.aspose.pdf.License getLicense(String licFile) {

// Create license object

com.aspose.pdf.License lic= new com.aspose.pdf.License();

try

{

// Specify the path of license file

lic.setLicense(licFile);

}

catch (Exception e)

{

e.printStackTrace();

}

return lic;

}


#4

I seem to be having this same issue. Is this forum still being monitored? If I provide my license and class would you be able to test and confirm that the license is being loaded correctly?


#5

@wwanamaker,
Sure, this forum is alive and you can send your license and class for testing. It is better that you create a new thread on the respective forum like if you are facing issue using Aspose.PDF, then post your query here. You may ensure that you do not share license on a public thread so mark your thread Private and then share your license and class. We will look into it and provide assistance accordingly.


#6

Thanks! I’ll start a new thread on aspose.words. Thank you!