Hello, I have a strange problem with “Convert a Range to jpg”, I have the following code:
Aspose.Cells.Range oRango = oWorkbook.Worksheets.GetRangeByName(“TABLA”);
Worksheet oHoja = oRango.Worksheet;
oHoja.PageSetup.LeftMargin = 0;
oHoja.PageSetup.RightMargin = 0;
oHoja.PageSetup.TopMargin = 0;
oHoja.PageSetup.BottomMargin = 0;
oHoja.AutoFitColumns();
oHoja.AutoFitRows();
oHoja.Cells.InsertColumn(oRango.ColumnCount + oRango.FirstColumn);
oHoja.Cells.SetColumnWidth(oRango.ColumnCount + oRango.FirstColumn, 0.15);
oHoja.PageSetup.PrintArea = CellsHelper.CellIndexToName(oRango.FirstRow, oRango.FirstColumn) + ":" + CellsHelper.CellIndexToName(oRango.FirstRow + oRango.RowCount - 1, oRango.FirstColumn + oRango.ColumnCount);
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg;
imgOptions.OnePagePerSheet = true;
SheetRender sr = new SheetRender(oHoja, imgOptions);
sr.ToImage(0, @"C:\BORRAR\Prueba.jpg");
System.Diagnostics.Process.Start(@"C:\BORRAR\Prueba.jpg");</font></font></span></div><div><span style="background-color: rgb(255, 255, 255); line-height: 24px; white-space: pre-wrap;"><font color="#212121"><font size="2"><br></font></font></span></div><div><font size="2"><span style="background-color: rgb(255, 255, 255); line-height: 24px; white-space: pre-wrap;"><font color="#212121">At new application works perfectly (prueba.jpg) , but when I insert this code into my big application with the <b>same varibles</b> </font></span><span style="color: rgb(33, 33, 33); font-family: inherit; line-height: 24px; white-space: pre-wrap; background-color: rgb(255, 255, 255);">does not work well </span><span style="color: rgb(33, 33, 33); line-height: 24px; white-space: pre-wrap; background-color: rgb(255, 255, 255);">(prueba2.jpg). </span></font></div><div><font size="2"><span style="color: rgb(33, 33, 33); line-height: 24px; white-space: pre-wrap; background-color: rgb(255, 255, 255);">Anyone idea? </span></font></div><div><font size="2"><span style="color: rgb(33, 33, 33); line-height: 24px; white-space: pre-wrap; background-color: rgb(255, 255, 255);">Thank you a lot.</span></font></div><div><span style="background-color: rgb(255, 255, 255); line-height: 24px; white-space: pre-wrap;"><font color="#212121"><font size="2"><br></font></font></span></div>