Png conversion of files very large or very long

hi, need help about this topic: i’m using aspose.cells to convert excel files as png images,one image per worksheet file.
Everything goes ok but if i use some files with so much columns or so much rows, result images can be very large (eg 20k pixel heigth)

there is some method to split worksheet images in multiple images if one image per worksheet is greater than some value (or smaller than some value in case of excel file using much columns so result image can be very small reading), or some way to deal with a sort of page setup to render worksheets as images?
thank you

Hi,


Thank you for contacting Aspose support.

As you are directing the API to print one image per worksheet, the resultant image will contain all the data in the worksheet, therefore the width and height of the image would be according to the amount of data to be rendered. If you turn off the ImageOrPrintOptions.OnePagePerSheet property, the API will auto calculate the horizontal and vertical page breaks, and consequently the data would be split across several images.

You may also control the amount of data to be rendered while using the Horizontal and Vertical page breaks.

C#

sheet.HorizontalPageBreaks.Add(“Y30”);
sheet.VerticalPageBreaks.Add(“Y30”);

Please check the below provided code snippet for your reference that automatically splits the data on multiple images.

C#

Workbook book = new Workbook(myDir + “sample.xls”);
Worksheet sheet = book.Worksheets[1];

ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;

imgOptions.OnePagePerSheet = false;
imgOptions.PrintingPage = PrintingPageType.IgnoreBlank;

SheetRender sr = new SheetRender(sheet, imgOptions);
for (int j = 0; j < sr.PageCount; j++)
{
sr.ToImage(j, myDir + sheet.Name + " Page" + (j + 1) + “.png”);
}


Please go through the following articles for better elaboration on the topic.
  1. Converting Worksheet to Image and Worksheet Page to Image
  2. Managing Page Breaks

Hope this helps a bit. Please feel free to write back in case you need our further assistance.

Hello

Long Path toll is the best solution for your problem. try it and solve you problem
<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
<w:UseFELayout/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><span style=“font-size:11.0pt;line-height:115%;
font-family:“Calibri”,“sans-serif”;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:
“Times New Roman”;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:“Times New Roman”;mso-bidi-theme-font:minor-bidi;
mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>

______________________________<!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

<![endif]–>

Hi,

Thanks for using Aspose.Cells.

Hopefully, your issue is resolved now. Let us know if you still facing any issue, we will be glad to look into it and help you further.