Free Support Forum - aspose.com

.PDF for .NET - lic shows older version

We purchased ASPOSE.PDF for .NET. The .lic file received by us show the version of Aspose as 2.2, whereas the demo version that was downloaded by us showed version 6.2.

Also the version 2.2 is not able to read some of the PDF file formats which version 6.2 is able to read.

What is the solution for this issue.

Hi,

The version number in the license file actually represents the license version not the component version. Please use the latest version of the component at your end with this license. If you still find any issues then please do let us know.

Regards,

Thanks a lot for the reply.

Previously, when we were working on the trial version of Aspose.Pdf.dll 6.0.0.0 and Aspose.Pdf.Kit.dll 5.8.0.0, everything was working fine.
We have recently purchased the Aspose PDF for .NET wherein Aspose.Pdf.Kit is merged within Aspose.Pdf.dll.

After putting the lic file and including the latest version of Aspose.Pdf.dll i.e. 6.3.0.0, I get the error “System.Xml.XmlException - Data at the root level is invalid. Line 1, position 1.” when I execute the code below:

protected void Button1_Click(object sender, EventArgs e)
{
FileStream fs1 = new FileStream(@“E:\AspNet\RnD\uploadedfiles\TestPDF.pdf”, FileMode.Open);
FileStream fs2 = new FileStream(@“E:\AspNet\RnD\uploadedfiles\TestPDF_Flatten.pdf”, FileMode.OpenOrCreate);
try
{
//open document
//Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form(lsLatestFileName, lsFolderPath + lsFileName.Substring(0, lsFileName.Length - 4) + “_Flatten.pdf”);
Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form(fs1, fs2);
//flatten fields
pdfForm.FlattenAllFields();
//save output
pdfForm.Save();

fs1.Close();
fs1.Dispose();
fs2.Close();
fs2.Dispose();

fs1 = new FileStream(@“E:\AspNet\RnD\uploadedfiles\TestPDF_Flatten.pdf”, FileMode.Open);
fs2 = new FileStream(@“E:\AspNet\RnD\uploadedfiles\TestPDF_New.pdf”, FileMode.OpenOrCreate);

//create PdfPageEditor object
PdfPageEditor pEdit = new PdfPageEditor();
//bind pdf file
pEdit.BindPdf(fs1);
//and assign it to PageSize property of the PdfPageEditor class
pEdit.PageSize = Aspose.Pdf.Facades.PageSize.A4;
pEdit.Alignment = AlignmentType.Center;
pEdit.VerticalAlignment = VerticalAlignmentType.Center;
//save the file
pEdit.Save(fs2);
pEdit = null;

fs1.Close();
fs1.Dispose();
fs2.Close();
fs2.Dispose();
}
catch (Exception ex)
{
fs1.Close();
fs1.Dispose();
fs2.Close();
fs2.Dispose();
}
}

I have attached the file for you to check.
Please let me know the solution at the earliest as the project is nearing its deadline.