Our .net license shows as an Eval license when we

Hi,

I am having trouble with a purchased license for ASPOSE.Total for .NET.

Here is the code used, the license still shows as ‘Evaluation’ but I am applying the license file.

The code is writing the PDF to Excel and outputting to filesystem (and also SharePoint after). The filesystem excel is attached

See output file attached and sample code below. Please confirm this license is correct if there is something incorrect with code or implementation, thanks

(I open the xlsx file in notepad and it says it is evaluation copy, is this correct? I think it should be full version.)

public override void ItemAdded(SPItemEventProperties properties)

{

try

{

EventFiringEnabled = false;

var license = new Aspose.Cells.License();

license.SetLicense("Aspose.Total.lic");

SPWeb web = properties.Web;

Aspose.Pdf.Document doc =

new Aspose.Pdf.Document(properties.ListItem.File.OpenBinaryStream());

SPFile file = null;

using (var memoryStream = new MemoryStream())

{

using (var stream = properties.ListItem.File.OpenBinaryStream())

stream.CopyTo(memoryStream);

Aspose.Pdf.Document pdfDoc = new Aspose.Pdf.Document(memoryStream);

memoryStream.Seek(0, SeekOrigin.Begin);

Aspose.Pdf.Text.TextAbsorber absorber = new Aspose.Pdf.Text.TextAbsorber();

absorber.TextSearchOptions.LimitToPageBounds = true;

pdfDoc.Pages.Accept(absorber);

File.WriteAllText(@"E:\Shared\temp_modified123.txt", absorber.Text);

pdfDoc.Save(memoryStream, Aspose.Pdf.SaveFormat.Excel);

Aspose.Cells.Workbook workBook = new Workbook(memoryStream);

workBook.Save(@"E:\Shared\temp_modified123.xlsx");

// Convert the document to byte form.

byte[] docBytes = memoryStream.ToArray();

using (MemoryStream inStream = new MemoryStream(docBytes))

{

//Save from memory stream to SharePoint

file = properties.List.RootFolder.Files.Add(

SPUrlUtility.CombineUrl(web.ServerRelativeUrl, properties.List.RootFolder.Url + "/"

+ properties.ListItem.File.Name

.ToLower().Trim().Replace(".pdf", ".xlsx")),

inStream);

file.Update();

}

}

}

catch (Exception er)

{ }

finally

{

base.ItemAdded(properties);

EventFiringEnabled = true;

}

}

Hi Jerry,


Thanks for using our API’s.

The issue is occurring because you have only initialized the license for Aspose.Cells and license is not initialized for Aspose.Pdf for .NET which is actually performing PDF to Excel file conversion. Please note that when using more than one API in single application, you need to explicitly instantiate license for each API.

[C#]
Aspose.Pdf.License pdflicense= new Aspose.Pdf.License();
pdflicense.SetLicense(@“C:\License\Aspose.Total.lic”);
pdflicense.Embedded = true;

Aspose.Cells.License cellslicense = new Aspose.Cells.License();
cellslicense.SetLicense(@“C:\License\Aspose.Total.lic”);