When I run the attached XLSX file through SheetRender.ToImage, I end up with different output on different PCs, even when running exactly the same binaries. As you can hopefully see in the attachments, the output on one PC is considerably more pleasant than the output on the other.
Hi,
Thanks for your posting and using the Aspose.Cells for .NET.
Probably, it is because of fonts.
However, please provide us your sample code. We will look into it and update you asap.
The C# 2.code we’re using follows.
public class ExcelConverter
{
public void Convert(string input, string output)
{
new License().SetLicense(“Aspose.Total.lic”);
Workbook book = new Workbook(input);
Worksheet sheet = book.Worksheets[0];ImageOrPrintOptions options = new ImageOrPrintOptions(); SheetRender render = new SheetRender(sheet, options); using (Bitmap src_bmp = render.ToImage(0)) { using (Bitmap dest_bmp = new Bitmap(332, 430)) { using (Graphics gr = Graphics.FromImage(dest_bmp)) gr.DrawImage(src_bmp, 0, 0, 332, 430); dest_bmp.Save(output, ImageFormat.Png); } } }
}
Thank you for any help you can offer!
Hi,
We suggest you to set
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.ImageFormat = ImageFormat.Emf;
If the issue still exists, please convert your image to XPS and send both results to us
imgOptions.SaveFormat = SaveFormat.XPS;
Using the EMF format did change the output on the pleasant PC (both the default format and the EMF format were pleasant), but didn’t seem to change much on the garbled PC.
options.SaveFormat = SaveFormat.XPS; SheetRender render = new SheetRender(sheet, options); render.ToImage(0, @"pleasant_output.xps");
The embedded font files are slightly different, but I don’t know enough about them to say how (or whether it really matters).
Hi,
Thanks for your feedback.
We have logged this issue in our database. If we require some more information on your part, we will let you know.
Once, we have some update/fix relating to this issue, we will let you know asap.
This issue has been logged as CELLSNET-40378.
Hi,
As we mentioned earlier.
gr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
gr.DrawImage(image, 0, 0, 332, 430);
We found it 's related to the default InterpolationMode between two PC.
Please set gr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High to solve this issue.
The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan