Hi,
“OutOfMemory” error raised during treatment of an image in our application.
We manage hundred of images, with no problem, and we don’t know why these ones generate errors.
I have attached the document.
Our implementation :
“Try
Dim szPDFFile as String = “C:\Dev\SA_IRD_PartA_54.53.F008_SECT41_iss1_2016-01-27.xlsm”
Dim wb As Aspose.Cells.Workbook = New Aspose.Cells.Workbook(szPDFFile)
Dim sb As Aspose.Cells.Worksheet = wb.Worksheets(0)
Dim p_o_Range As Aspose.Cells.Range = sb.Cells.CreateRange(“B6:AO45”)
p_o_Range.SetOutlineBorder(Aspose.Cells.BorderType.TopBorder, Aspose.Cells.CellBorderType.None, System.Drawing.Color.Empty)
p_o_Range.SetOutlineBorder(Aspose.Cells.BorderType.BottomBorder, Aspose.Cells.CellBorderType.None, System.Drawing.Color.Empty)
p_o_Range.SetOutlineBorder(Aspose.Cells.BorderType.LeftBorder, Aspose.Cells.CellBorderType.None, System.Drawing.Color.Empty)
p_o_Range.SetOutlineBorder(Aspose.Cells.BorderType.RightBorder, Aspose.Cells.CellBorderType.None, System.Drawing.Color.Empty)
sb.PageSetup.ClearHeaderFooter()
sb.PageSetup.FooterMargin = 0
sb.PageSetup.HeaderMargin = 0
sb.Cells.ClearFormats(5, IRDEditorTools.CheckRules.GetColNum(“B”) - 1, 44, IRDEditorTools.CheckRules.GetColNum(“B”) - 1)
sb.Cells.ClearFormats(40, IRDEditorTools.CheckRules.GetColNum(“AL”) - 1, 44, IRDEditorTools.CheckRules.GetColNum(“AO”) - 1)
sb.Cells.ClearContents(40, IRDEditorTools.CheckRules.GetColNum(“AL”) - 1, 44, IRDEditorTools.CheckRules.GetColNum(“AO”) - 1)
sb.PageSetup.LeftMargin = 0
sb.PageSetup.RightMargin = 0
sb.PageSetup.TopMargin = 0
sb.PageSetup.BottomMargin = 0
Dim options As Aspose.Cells.Rendering.ImageOrPrintOptions = New Aspose.Cells.Rendering.ImageOrPrintOptions()
options.OnePagePerSheet = True
options.ImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg
options.Quality = 75
options.HorizontalResolution = 300
options.VerticalResolution = 300
sb.PageSetup.PrintArea = “B6:AO45”
Dim sr As Aspose.Cells.Rendering.SheetRender = New Aspose.Cells.Rendering.SheetRender(sb, options)
sr.ToImage(0, szPDFFile + “.jpg”)
Catch ex As Exception
Dim aa As String = ex.Message
End Try”
Thanks for the support
Hi,
Sample code:
string szPDFFile
= “e:\test2\SA_IRD_PartA_54.53.F008_SECT41_iss1_2016-01-27.xlsm”;<o:p></o:p>
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(szPDFFile);
wb.Settings.MemorySetting = MemorySetting.MemoryPreference;//This does not make any difference.
Aspose.Cells.Worksheet sb = wb.Worksheets[0];
Aspose.Cells.Range p_o_Range = sb.Cells.CreateRange("B6:AO45");
p_o_Range.SetOutlineBorder(Aspose.Cells.BorderType.TopBorder, Aspose.Cells.CellBorderType.None, System.Drawing.Color.Empty);
p_o_Range.SetOutlineBorder(Aspose.Cells.BorderType.BottomBorder, Aspose.Cells.CellBorderType.None, System.Drawing.Color.Empty);
p_o_Range.SetOutlineBorder(Aspose.Cells.BorderType.LeftBorder, Aspose.Cells.CellBorderType.None, System.Drawing.Color.Empty);
p_o_Range.SetOutlineBorder(Aspose.Cells.BorderType.RightBorder, Aspose.Cells.CellBorderType.None, System.Drawing.Color.Empty);
sb.PageSetup.ClearHeaderFooter();
sb.PageSetup.FooterMargin = 0;
sb.PageSetup.HeaderMargin = 0;
//sb.Cells.ClearFormats(5, IRDEditorTools.CheckRules.GetColNum("B") - 1, 44, IRDEditorTools.CheckRules.GetColNum("B") - 1);
//sb.Cells.ClearFormats(40, IRDEditorTools.CheckRules.GetColNum("AL") - 1, 44, IRDEditorTools.CheckRules.GetColNum("AO") - 1);
//sb.Cells.ClearContents(40, IRDEditorTools.CheckRules.GetColNum("AL") - 1, 44, IRDEditorTools.CheckRules.GetColNum("AO") - 1);
sb.PageSetup.LeftMargin = 0;
sb.PageSetup.RightMargin = 0;
sb.PageSetup.TopMargin = 0;
sb.PageSetup.BottomMargin = 0;
Aspose.Cells.Rendering.ImageOrPrintOptions options = new Aspose.Cells.Rendering.ImageOrPrintOptions();
options.OnePagePerSheet = true;
options.ImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg;
options.Quality = 75;
options.HorizontalResolution = 300;
options.VerticalResolution = 300;
sb.PageSetup.PrintArea = "B6:AO45";
Aspose.Cells.Rendering.SheetRender sr = new Aspose.Cells.Rendering.SheetRender(sb, options);
sr.ToImage(0, szPDFFile + “.jpg”);//Exception
occurred.
I have logged a ticket with an id “CELLSNET-45350” for your issue. We will look into it soon.
Hi,
The issues you have found earlier (filed as CELLSNET-45350) have been fixed in Aspose.Cells for .NET 17.5.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi,