Hi, we experiencing a big problem with excel files (attached here)
The file result more than 8000 pages when converting to png images and more than 32000 pages converting in PDF.
Result in site production is web server crash.
Some Advice or update to avoid this problem? maybe consideration about number of columns?
can we apply some other consideration when using excel files?
here’s the code we use to export file in images (a loop for every worksheet and for every sheet page count) and pdf export:
for (int i = 0; i < ((Aspose.Cells.Workbook)m_oDocument).Worksheets.Count; i++)
{
Aspose.Cells.Rendering.SheetRender oSheet = new Aspose.Cells.Rendering.SheetRender(((Aspose.Cells.Workbook)m_oDocument).Worksheets[i], OptionsC);
iTotalPagesCount += oSheet.PageCount;
if (_iPageIndex < iTotalPagesCount)
{
oSheet.ToImage(_iPageIndex - iSheetsPagesCount, _oOutputStream);
break;
}
iSheetsPagesCount = iTotalPagesCount;
}
—
Aspose.Cells.PdfSaveOptions OptionsC = new Aspose.Cells.PdfSaveOptions();
OptionsC.AllColumnsInOnePagePerSheet = true;
((Aspose.Cells.Workbook)m_oDocument).Save(_oOutputStream, OptionsC);
thank’s a lot
Hi Valerio,
Thank’s for advice: we’re now using PrintingPageType.IgnoreBlank
and some other considerations in term of columns number and width and it seems to work pretty good
BUT we have still a question with page count:
using ignoreblank, OnePagePerSheet = true, and Cells.DeleteBlankColumns()
we obtain a good aspose.cells file and when we use this code:
Aspose.Cells.Rendering.SheetRender oSheetR = new Aspose.Cells.Rendering.SheetRender(((Aspose.Cells.Workbook)m_oDocument).Worksheets[i], OptionsC);
m_iPageCount += oSheetR.PageCount;
we have a pagecount of 1
but when we save object as PDF:
Aspose.Cells.PdfSaveOptions OptionsC = new Aspose.Cells.PdfSaveOptions();
OptionsC.AllColumnsInOnePagePerSheet = true;
OptionsC.PrintingPageType = Aspose.Cells.PrintingPageType.IgnoreBlank;
((Aspose.Cells.Workbook)m_oDocument).Save(_oOutputStream, OptionsC);
we get a 3 pages PDF files
So there is a way to know pdf pages (with AllColumnsInOnePagePerSheet = true) before saving pdf?
Hi Valerio,
//open document
var pdfDocument = new Aspose.Pdf.Document(oOutputStream);
//get page count
Console.WriteLine(“Page Count : {0}”, pdfDocument.Pages.Count);