Free Support Forum - aspose.com

Issue with printed document : Evaluation Only. Created with Aspose.Pdf. Copyright 2002-2011 Aspose Pty Ltd

Hi,


We are using PdfViewer API to print the documents. We have already been using Aspose.pdf redistributable license. However , in the client environment we are getting this evaluation message which i have mentioned in the subject. I am unable to reproduce the license evaluation issue on my local machine.

Client environment is Windows Server 2012. is there some specific registry or security setting which i can perform on client machine. I have tried to set the license as per the suggestions from Aspose licensing help and asked client to try and run the application. However i wanted to know if i could check some other things which may cause this issue in their environment.

The code block we are using to print is below:
var viewer = new PdfViewer();
viewer.OpenPdfFile(fileName);

//Set attributes for printing
viewer.AutoResize = true;
viewer.AutoRotate = true;
viewer.PrintPageDialog = false;

//Create objects for printer and page settings and PrintDocument
var ps = new PrinterSettings();
var pgs = new PageSettings();

ps.PrinterName = Printer;
pgs.Margins = new Margins(0, 0, 0, 0);
viewer.PrintDocumentWithSettings(pgs, ps);
viewer.ClosePdfFile();

Thanks,
Sumeet

The code which sets the license is below:


void SetLicense()
{
var applicationPath = AppDomain.CurrentDomain.BaseDirectory;
var licensePath = Path.Combine(applicationPath, “Aspose.Pdf.lic”);

if (!File.Exists(licensePath))
{
throw new FileNotFoundException(string.Format(“Aspose.Pdf.lic file not found in {0}.”, applicationPath));
}

var license = new License();
license.SetLicense(licensePath);
}

Please let me also know the way to send lic file once an aspose staff member gets allocated to the issue i have raised.

Hi Sumeet,

Sumeet21:
Hi,

We are using PdfViewer API to print the documents. We have already been using Aspose.pdf redistributable license. However , in the client environment we are getting this evaluation message which i have mentioned in the subject. I am unable to reproduce the license evaluation issue on my local machine.

Client environment is Windows Server 2012. is there some specific registry or security setting which i can perform on client machine. I have tried to set the license as per the suggestions from Aspose licensing help and asked client to try and run the application. However i wanted to know if i could check some other things which may cause this issue in their environment.

The code block we are using to print is below:
var viewer = new PdfViewer();
viewer.OpenPdfFile(fileName);

//Set attributes for printing
viewer.AutoResize = true;
viewer.AutoRotate = true;
viewer.PrintPageDialog = false;

//Create objects for printer and page settings and PrintDocument
var ps = new PrinterSettings();
var pgs = new PageSettings();

ps.PrinterName = Printer;
pgs.Margins = new Margins(0, 0, 0, 0);
viewer.PrintDocumentWithSettings(pgs, ps);
viewer.ClosePdfFile();

Thanks,
Sumeet

Thanks for your inquiry. It is suggested to set license in some Application Level event. When you will set the license in application level event/scope, it will remain valid till the lifespan of application.

  • If you are developing an ASP.NET application, you can call License.SetLicense from the Global.asax.cs (Global.asax.vb) file, in the Application_Start protected method. It is called once when the application starts. Do not call License.SetLicense from within Page_Load methods since it means the license will be loaded every time a web page is loaded.
  • If you are developing a Windows Forms or console application, call License.SetLicense in your startup code, before using Aspose.Pdf for .NET classes.
  • If you are developing a class library, you can call License.SetLicense from a static constructor of your class that uses Aspose.Pdf for .NET. The static constructor will execute before an instance of your class is created making sure Aspose.PDF for .NET license is properly set.


Please try to set license as per your application structure and share the results.


Best Regards,

Hi Sumeet,

Sumeet21:
Please let me also know the way to send lic file once an aspose staff member gets allocated to the issue i have raised.

Thanks for your inquiry. As you told above that your license implementation is working fine at your end, so it seems it is not the license issue but implementation logic. However, please check documentation link to know how to share license file with Aspose staff if required.

Best Regards,

Hi Tilal,


I was curious to know as to what does license.SetLicense does and does it put any registry entry on the machine. Please let me know.

Thanks,
Sumeet
Sumeet21:
I was curious to know as to what does license.SetLicense does and does it put any registry entry on the machine. Please let me know.
Hi Sumeet,

The SetLicense(..) method initializes API license and its validation remains active throughout the application life cycle (the time-frame for which the application is running) and it does not add any entry to system registry.

Hi,


I have a scenrio where we have 2 Aspose.pdf licenses with different version.
One license we have is being used in the web and we are setting the license each time we are assessing the api.
Other license for which the client has reported Evaluation issue while printing , uses different version of Aspose.pdf and license file. This is a WCF service which is hosted in windows service . To fix this i sent them the code fix which sets the license thru license file and it worked for them But however, the client reported that the reports in the web which didnot show any Evaluation error , have now started displaying this. Although the license file and the versions are different , it shouldnt have affected the earlier reports which doesnt run under windows service instance. So, client got it fixed by resinstating the original dll which didnt have setlicense code in WCF service and the did IISRESET. After doing this they say that they dont face any issue with printing in either web or windows service.

I dont understand what happenned and why client got an issue with existing reports which were working earlier for them and how did IISRESET fixed everything. Now they dont have any setlicense code in windows service but still their reports are working fine. With the dll they replaced provided by us , it started working for reports running under windows service instance but the reports which were using different Aspose.pdf version and lic file were working and after applying this change they got affected. I am not sure how this affected the reports which were otherwise working fine. How did IISRESET fixed all the reports - 1. The existing reports used in asp.net context which already used setlicense api and got affected by our change in woindows service component 2.the one for which we provided the dll as a part of windows service context and then they replaced it with original thinking that the dll provided by us affected reports.

Is there some conflict due to which it could have happened because we have 2 different versions of pdf and license files or some kind of overriding underneath which affected the reports which otherwise were working fine before we provided the dll to set the license. Please throw some light on it.

Hi Sumeet,


Thanks for sharing the details.

I have gone through the complete scenario description stated in earlier post and honestly speaking, I could not figure out the reasons why a working instance (application producing correct output) started generating PDF files with evaluation watermark once the client have applied your fix/updated solution, and how the instance causing issues immediately fixed the license initialization issue and started to produce correct output. However one thing I would like to know is the Aspose.Pdf for .NET version which you are using in both instances ?

Some of the customers reported related issues in past but once they upgraded to latest releases, their issues were fixed. Can you please try using the latest release Aspose.Pdf for .NET 10.7.0 and see if it can fix your problem.