Hello,
Hi William,
- Babar, thank you for your reply. I tried setting the FontDirs:CellsHelper.FontDirs = new ArrayList(){“/usr/share/fonts”,“/usr/X11R6/lib/X11/fonts”,“/usr/local/share/fonts”,“~/.fonts”,};And I installed ttf-mscorefonts-installer to make sure that the Arial was available (it gets installed to /usr/share/fonts). But saving as pdf is still extremely slow. I even trimmed down the document we were generating to just text and no charts and it takes almost two minutes to save as pdf on ubuntu/mono where it is under a second on Windows/.NET.Do you have any other suggestions to improve the speed?2) It doesn’t appear that you can change the font in the Equation Editor in Excel to anything other than Cambria Math, which is limited to Windows only. Do you have any other suggestions on what to do here?3) Thank you, please let us know.
Hi William,
Thank you, Babar. Upgrading to Aspose.Cells for .NET 8.0.0.1 fixed the performance issue. I didn’t realize I was using an older version. Using a single or multiple directories for the font lookups doesn’t seem to make a noticeable performance difference.
One other note: generation of pdf’s very frequently crashes mono with the following error:
Hi William,
Hello Babar,
Hi William,
Hi William,
Thank you, Babar. Please keep me updated on the status. The crashing bug is much more important to us than the equation editor bug, if that is important for you to know. Also, as I indicated above, we are using Mono 3.2.7, but if you fix the crash on Mono 2.10.8.1, I can try the fix out on the version of mono that we are using.
Hi William,
Thank you Babar. Pdf exporting will be a very important feature for us so we appreciate the help.
Hello, Babar. Do you have an update on this issue?
Hi William,
Hello Babar, do you have any valuable feedback from the development team that you have received over the past week since your last post here?
Hi William,
Thank you, Babar. Please keep me updated.
Hi William,
- CELLSNET-42528: Unfortunately, the current implementation of Aspose.Cells APIs do not support math equations as they are in your provided sample (json-test-1.xlsx). This is actually a new feature request that we may consider implementing in the future releases, but we first need to analyze it properly in order to bring it on our road map of Aspose.Cells APIs. Therefore we can not commit any timelines at the moment although the ticket is still open for further investigation.
- CELLSNET-42539: The exception stated in this ticket is due to the reason that Aspose.Cells APIs converts the spreadsheets, charts and shapes to EMF format, and inject these EMF images into the resultant PDF. On the other hand, Mono does not support creation of EMF files as we have researched it. You can workaround this situation by specifying the ImageFormat for the object of PdfSaveOptions while converting the spreadsheets to PDF format. Please check the below provided code snippet that we have tested against Mono versions 3.2.6 & 3.2.8 with MonoDevelop 4.0.12 and the latest version of Aspose.Cells for .NET 8.0.1.1.
var file = “/home/babar/Downloads/Tear_Sheet_values.xlsx”;
Workbook book = new Workbook(file);
Console.WriteLine(“Spreadsheet Loaded!”);
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
Console.WriteLine(“Spreadsheet Converted!”);
System.Drawing.Bitmap dummyBitmap = null; System.Drawing.Graphics dummyGfx = null; IntPtr hdc = IntPtr.Zero; System.Drawing.Imaging.Metafile metafile = null;
try { // Below code is needed to create a .NET Graphics object that can record a metafile. dummyBitmap = new System.Drawing.Bitmap(1, 1); dummyGfx = System.Drawing.Graphics.FromImage(dummyBitmap);
hdc = dummyGfx.GetHdc();
Console.WriteLine(hdc);
int mWidth = 200; int mHeight = 200;
metafile = new System.Drawing.Imaging.Metafile(fs, hdc, new System.Drawing.RectangleF(0, 0, mWidth, mHeight), System.Drawing.Imaging.MetafileFrameUnit.Pixel, System.Drawing.Imaging.EmfType.EmfPlusDual);
System.Drawing.Graphics mGr = System.Drawing.Graphics.FromImage(metafile); // Use FillRectangle instead of Clear because Clear does nto seem to work for metafiles. // FillRectangle also establishes good page boundaries for the metafile.
Console.WriteLine(mGr.VisibleClipBounds);
mGr.FillRectangle(new System.Drawing.SolidBrush(Color.Empty), 0, 0, mWidth, mHeight);
//Draws mGr.DrawString(" Test draw text!", new System.Drawing.Font("Arail", 8), new System.Drawing.SolidBrush(System.Drawing.Color.Red), 50, 10); mGr.DrawLine(new System.Drawing.Pen(Color.Blue, 3), 0, 100, 200, 100); mGr.FillRectangle(new System.Drawing.SolidBrush(Color.FromArgb(100, 255, 0, 0)), 50, 50, 100, 100); mGr.Dispose(); } finally { if (metafile != null) metafile.Dispose(); if (hdc != IntPtr.Zero) dummyGfx.ReleaseHdc(hdc); if (dummyGfx != null) dummyGfx.Dispose(); if (dummyBitmap != null) dummyBitmap.Dispose(); }
Hello, Babar. Thank you for your reply.