We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Cells (Save as PDF)

I am having a strange issue with some existing code that has been working fine. Nothing has changed with my .NET application and all of a sudden, I am having issues saving an Excel workbook to a memory stream as PDF. My code is as follows:

Workbook book = new Workbook();
MemoryStream pdfReport = new MemoryStream();
book.Save(pdfReport, SaveFormat.Pdf);

The book.Save line is generating a very strange issue that is impossible to decipher (literally). The stack trace is available below:

CellsException was unhandled by user code

at ᪷.Ṡ.ṵ(String ؇, Single Ṷ, FontStyle ԭ)
at ᪷.ṓ.ṝ()
at ᪷.ᴡ.get_ᴤ()
at ᪷.䷯.丁(PointF ᵟ, String Ո)
at ᪷.䷯.䷸(PointF ᵟ, String Ո)
at ᪷.䷯.⚩(PointF ᵟ, String Ո)
at ᪷.个.⚩()
at ᪷.个.Ძ()
at ᪷.个.PlayRecord(ᰇ record)
at ᪷.严.:no_entry:(PointF ᵟ, SizeF ߾)
at ᪷.䷭.ᆘ(ᯗ ䷮, PointF ᵟ, SizeF ߾)
at ᪷.䷭.ᆘ(╮ ᭹)
at ᪷.䷫.VisitImage(╮ image)
at ᪷.╮.Accept(╊ visitor)
at ᪷.╅.Accept(╊ visitor)
at ᪷.╬.Accept(╊ visitor)
at ᪷.╅.Accept(╊ visitor)
at ᪷.╬.Accept(╊ visitor)
at ᪷.╅.Accept(╊ visitor)
at ᪷.╬.Accept(╊ visitor)
at ᪷.╅.Accept(╊ visitor)
at ᪷.╘.Accept(╊ visitor)
at 㒹.䴘.Accept(╊ visitor)
at ᪷.䷫.Render(╈ node)
at 䉵.䳫.◁()
at 䉵.䳫.״(Stream 䴃)

Hi,


Thanks for providing us sample code and some details.

Please try our latest version/fix: Aspose.Cells for .NET v8.6.0.2

I have tested your scenario/ case using your sample code with v8.6.0.2, it works fine and I do not get any exception what so ever. I even added my code to your code snippet to write the PDF stream into a file. I have also attached the output file generated by the sample code:
e.g
Sample code:

Workbook book = new Workbook();
MemoryStream pdfReport = new MemoryStream();
book.Save(pdfReport, SaveFormat.Pdf);
//Add my code to write the stream into file.
pdfReport.Seek(0, SeekOrigin.Begin);
byte[] buffer = new byte[pdfReport.Length];
buffer = pdfReport.ToArray();
MessageBox.Show(pdfReport.Length.ToString()); //It provides me the length. -OK
FileStream fs = new FileStream(“e:\test2\out1mygeneratedPDF.pdf”, FileMode.Create);
fs.Write(buffer, 0, buffer.Length);
fs.Close();
pdfReport.Close();


Thank you.

Will my existing license for version 7.0.1.0 still work? Also, This code has been running fine and now all of a sudden it ceases to function. I’d really like to be able to decipher the stack trace but I suspect I am missing a component to Aspose.Cells which is why I’m getting the crazy Windings/Chinese/Japanese stack trace.

Thank you,
Mike

Hi,


Well, I am afraid, your existing license is expired, so you cannot use it with latest versions of the product. I have no clue to your stack trace where is the issue. Also, we cannot evaluate your issue in older versions, we can only test the issues using latest APIs set of the product and if we find any issue, we may log it into our database to figure it out soon. By the way, as you said, if it was working fine and suddenly, you got this issue now, well, this also looks strange as it should always work fine. We also suggest you to try your scenario/ case by creating a new VS.NET project on some other system/ pc if it works fine.

Thank you.