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

Free Support Forum - aspose.com

Aspose Cells on Mono

Hello

I
have a problem with Aspose on Mono, I load an excel file which serves
as a model, I replace the fields, and I save the file in pdf, so far,
so good.

When I save my pdf file, I get an error, excel no problems.

Dim memStream As IO.MemoryStream = New IO.MemoryStream()
workbook.Save(memStream, Aspose.Cells.FileFormatType.Pdf)

The error :

Directory
‘/home/ndrou/Projects/IntranetVocation/IntranetVocation/fonts’ not
found. at System.IO.Directory.GetFileSystemEntries (System.String path,
System.String searchPattern, FileAttributes mask, FileAttributes attrs)
[0x00000] at System.IO.Directory.GetFiles (System.String path,
System.String searchPattern) [0x00000] at
System.IO.DirectoryInfo.GetFiles (System.String searchPattern)
[0x00000] at System.IO.DirectoryInfo.GetFiles () [0x00000] at (wrapper
remoting-invoke-with-check) System.IO.DirectoryInfo:GetFiles () at
xf3a0b8f07ddf3d3a.x6412d0c71c34c05c.x72a00e077daab0e9 () [0x00000] at
xf3a0b8f07ddf3d3a.x6412d0c71c34c05c…ctor () [0x00000] at
xcfc89de1049abe88.xba2f911354958a68…ctor
(xcfc89de1049abe88.x4882ae789be6e2ef context, System.String familyName,
FontStyle requestedStyle, Boolean IsEmbed) [0x00000] at
xcfc89de1049abe88.x0c228b6673bb03aa…ctor
(xcfc89de1049abe88.x4882ae789be6e2ef context, System.String familyName,
FontStyle requestedStyle) [0x00000] at
xcfc89de1049abe88.xba2f911354958a68.xfbef538c77b14236
(xcfc89de1049abe88.x4882ae789be6e2ef x0f7b23d1c393aed9, System.String
xa79a9f649c74f4a4, FontStyle xdf2a58420a175f25, Boolean
x032642d61fba2b03) [0x00000] at
xcfc89de1049abe88.xe21bbe9dfab6c4dd.x9059a3203c8fc855 (System.String
xa79a9f649c74f4a4, FontStyle x44ecfea61c937b8e, Boolean
x032642d61fba2b03) [0x00000] at
xcfc89de1049abe88.x79e4013ca0fc082a.xd6b2549ca8b77560
(xcfc89de1049abe88.xcc8c7739d82c63ba x199c511544621683) [0x00000] at
xcfc89de1049abe88.xd6b2a42851fedfba.xc7234004e9b72a7e
(xcfc89de1049abe88.xcc8c7739d82c63ba x199c511544621683) [0x00000] at
xcfc89de1049abe88.x92faf2a956f0f5a7.VisitGlyphs
(xcfc89de1049abe88.xcc8c7739d82c63ba glyphs) [0x00000] at
xcfc89de1049abe88.xcc8c7739d82c63ba.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xbaec545ec01f92ca.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xb8e7e788f6d59708.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xbaec545ec01f92ca.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xb8e7e788f6d59708.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xbaec545ec01f92ca.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xb8e7e788f6d59708.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xbaec545ec01f92ca.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xc67adcdbca121a26.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.x92faf2a956f0f5a7.Render
(xcfc89de1049abe88.x4fdf549af9de6b97 node) [0x00000] at
xf1e06fd8be9d8c69.xd285aa8659b8b74e.x6210059f049f0d48 () [0x00000] at
xf1e06fd8be9d8c69.xd285aa8659b8b74e.x0acd3c2012ea2ee8 (System.IO.Stream
xcf18e5243f8d5fd3) [0x00000]



When I create the directory “fonts”, I get the following error:


Object reference not set to an instance of an object at
xcfc89de1049abe88.x0c228b6673bb03aa.BuildBaseFontName () [0x00000] at
xcfc89de1049abe88.xba2f911354958a68…ctor
(xcfc89de1049abe88.x4882ae789be6e2ef context, System.String familyName,
FontStyle requestedStyle, Boolean IsEmbed) [0x00000] at
xcfc89de1049abe88.x0c228b6673bb03aa…ctor
(xcfc89de1049abe88.x4882ae789be6e2ef context, System.String familyName,
FontStyle requestedStyle) [0x00000] at
xcfc89de1049abe88.xba2f911354958a68.xfbef538c77b14236
(xcfc89de1049abe88.x4882ae789be6e2ef x0f7b23d1c393aed9, System.String
xa79a9f649c74f4a4, FontStyle xdf2a58420a175f25, Boolean
x032642d61fba2b03) [0x00000] at
xcfc89de1049abe88.xe21bbe9dfab6c4dd.x9059a3203c8fc855 (System.String
xa79a9f649c74f4a4, FontStyle x44ecfea61c937b8e, Boolean
x032642d61fba2b03) [0x00000] at
xcfc89de1049abe88.x79e4013ca0fc082a.xd6b2549ca8b77560
(xcfc89de1049abe88.xcc8c7739d82c63ba x199c511544621683) [0x00000] at
xcfc89de1049abe88.xd6b2a42851fedfba.xc7234004e9b72a7e
(xcfc89de1049abe88.xcc8c7739d82c63ba x199c511544621683) [0x00000] at
xcfc89de1049abe88.x92faf2a956f0f5a7.VisitGlyphs
(xcfc89de1049abe88.xcc8c7739d82c63ba glyphs) [0x00000] at
xcfc89de1049abe88.xcc8c7739d82c63ba.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xbaec545ec01f92ca.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xb8e7e788f6d59708.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xbaec545ec01f92ca.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xb8e7e788f6d59708.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xbaec545ec01f92ca.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xb8e7e788f6d59708.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xbaec545ec01f92ca.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.xc67adcdbca121a26.Accept
(xcfc89de1049abe88.xf51865b83a7a0b3b visitor) [0x00000] at
xcfc89de1049abe88.x92faf2a956f0f5a7.Render
(xcfc89de1049abe88.x4fdf549af9de6b97 node) [0x00000] at
xf1e06fd8be9d8c69.xd285aa8659b8b74e.x6210059f049f0d48 () [0x00000] at
xf1e06fd8be9d8c69.xd285aa8659b8b74e.x0acd3c2012ea2ee8 (System.IO.Stream
xcf18e5243f8d5fd3) [0x00000]


Please Help !

Thanks in advance.

Hi,

Please try the attached version.

If you still find the issue, kindly post your template excel file here, we will check your issue soon.

Thank you.

This
patch has corrected the problem, but now the problem occurred when I run
the save method MemoryStream on my (still in the case of the pdf, excel
it works), my stream is empty …

Hi,

Could you give us your sample code, we will check your issue soon.

Thank you.

And, here is my test code that works absolutely fine with a template Excel file.

Sample code:
Workbook workbook = new Workbook();
workbook.Open(“e:\test\MyBook.xlsx”);
MemoryStream ms = new MemoryStream();
workbook.Save(ms, FileFormatType.Pdf);
ms.Seek(0, SeekOrigin.Begin);
byte[] buffer = new byte[ms.Length];
buffer = ms.ToArray();
FileStream fs = new FileStream(“e:\test\outFile.pdf”, FileMode.Create);
fs.Write(buffer, 0, buffer.Length);
fs.Close();
ms.Close();

Thank you.

Hi,

If you still could not evaluate your issue, kindly give us your template file here and which version of Mono you are using.

Thank you.

I tested the following C # code:

Aspose.Cells.License licAspose = new Aspose.Cells.License();
licAspose.SetLicense(“Aspose.Cells.lic”);
Aspose.Cells.Workbook xlsdoc = new Aspose.Cells.Workbook();
xlsdoc.Worksheets[0].Cells[0,0].PutValue(“test”);
xlsdoc.Save(“test.pdf”, Aspose.Cells.FileFormatType.Pdf, Aspose.Cells.SaveType.OpenInBrowser, Response);

I get the following error :

System.IndexOutOfRangeException: Array index is out of range.
at System.Web.HttpResponseStream+ByteBucket.Write (System.Byte[] buf, Int32 offset, Int32 count) [0x00000]
at System.Web.HttpResponseStream.AppendBuffer (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000]
at System.Web.HttpResponseStream.Write (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000]
at System.IO.MemoryStream.WriteTo (System.IO.Stream stream) [0x00000]
at Aspose.Cells.Workbook.Save (System.String fileName, SaveType saveType, FileFormatType fileFormatType, System.Web.HttpResponse response, System.Text.Encoding encoding) [0x00000]
at Aspose.Cells.Workbook.Save (System.String fileName, SaveType saveType, FileFormatType fileFormatType, System.Web.HttpResponse response) [0x00000]
at Aspose.Cells.Workbook.Save (System.String fileName, FileFormatType fileFormatType, SaveType saveType, System.Web.HttpResponse response) [0x00000]
at csharpIntraVoc.test.Page_Load (System.Object sender, System.EventArgs e) [0x00039] in /home/ndrou/Projects/csharpIntraVoc/csharpIntraVoc/test.aspx.cs:18
at System.Web.UI.Control.OnLoad (System.EventArgs e) [0x00000]
at System.Web.UI.Control.LoadRecursive () [0x00000]
at System.Web.UI.Page.ProcessLoad () [0x00000]
at System.Web.UI.Page.ProcessPostData () [0x00000]
at System.Web.UI.Page.InternalProcessRequest () [0x00000]
at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000]


But when I delete the following line (blank document) :


xlsdoc.Worksheets[0].Cells[0,0].PutValue(“test”);

It works !

I don’t understand anything!


No ideas ?

I success to generate Excel file, but Pdf it doesn’t work !

A empty worbook, I can save it as Pdf, but when I write datas in this workbook, it doesn’t work in Pdf, only Excel works.

Thanks in advance.

Hi,

We are looking into your issue and get back to you soon.

Thank you.

Ok fantastic !

Thanks a lot.