Hi,
When using SheetRender.ToImage to generate image from Excel range the superscript and subscript text is shifted up too much (please see the attached image).
For reproducing the issue please use the attached Excel file and the following code:
var workbook = new Workbook(“29859.xlsx”);
workbook.Worksheets[0].PageSetup.TopMargin = 0;
workbook.Worksheets[0].PageSetup.LeftMargin = 0;
workbook.Worksheets[0].PageSetup.RightMargin = 0;
workbook.Worksheets[0].PageSetup.BottomMargin = 0;
workbook.Worksheets[0].PageSetup.PrintArea = “A3:S6”;
var sheetRender = new SheetRender(workbook.Worksheets[0], CreateImageOptions());
var image = sheetRender.ToImage(0);
image.Save(“output.png”);
private static ImageOrPrintOptions CreateImageOptions()
{
return new ImageOrPrintOptions
{
Quality = 100,
VerticalResolution = 200,
HorizontalResolution = 200,
PrintingPage = PrintingPageType.IgnoreBlank,
ImageFormat = ImageFormat.Png,
OnePagePerSheet = true,
OnlyArea = true
};
}
Best regards,
Aurelian Iordache
Software Developer
IBM Romania
Hi,
Sample code:
var workbook = new Workbook(“e:\test2\29859.xlsx”);
workbook.Worksheets[0].PageSetup.TopMargin = 0;
workbook.Worksheets[0].PageSetup.LeftMargin = 0;
workbook.Worksheets[0].PageSetup.RightMargin = 0;
workbook.Worksheets[0].PageSetup.BottomMargin = 0;
workbook.Worksheets[0].PageSetup.PrintArea = “A3:S6”;
var sheetRender = new SheetRender(workbook.Worksheets[0], CreateImageOptions());
var image = sheetRender.ToImage(0);
image.Save(“e:\test2\out1.png”);
…
private ImageOrPrintOptions CreateImageOptions()
{
return new ImageOrPrintOptions
{
Quality = 100,
VerticalResolution = 200,
HorizontalResolution = 200,
PrintingPage = PrintingPageType.IgnoreBlank,
ImageFormat = ImageFormat.Png,
OnePagePerSheet = true,
OnlyArea = true
};
}
Hi Aurelian,
This is to inform you that we have fixed the problem logged earlier as CELLSNET-43854. We will shortly provide the fix here after incorporating other enhancements and performing QA. As soon as the next release is available for public use, we will notify you here in reference to the aforesaid ticket.
Hi,
Thanks for your using Aspose.Cells.
Please download and try the latest fix: Aspose.Cells for .NET v8.5.2.2 and let us know your feedback.
Hi,
Thank you for the fix. However we cannot test this build, we have to wait for the .NET framework 4 version of your code.
Thanks!
Hi,
The issues you have found earlier (filed as CELLSNET-43854) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.