Good day.
I have been rendering excel worksheets to image for some time now. Usually it causes no problem.
But using the attached .xls file, it renders an image that is much larger than the document.
I am using the following code (ColdFusion):
<cfset wb = createObject(“java”,“com.aspose.cells.Workbook”).init(filexls)>When I output the maxDataRow() and maxDataColumn() of cells, it indicates 55 and 5, respectively, which is correct; it is not expanding the image to fit an “outlier” cell.
<cfset ws=wsc.get(javacast(“int”,0))>
<cfset ws=wsc.get(javacast(“int”,0))>
<cfset pageSetup.setBottomMargin(javacast(“int”,0))>
<cfset pageSetup.setTopMargin(javacast(“int”,0))>
<cfset pageSetup.setLeftMargin(javacast(“int”,0))>
<cfset pageSetup.setRightMargin(javacast(“int”,0))>
<cfset ipo=createObject(“java”,“com.aspose.cells.ImageOrPrintOptions”)>
<cfset ipo.setHorizontalResolution(javacast(“int”,200))>
<cfset ipo.setVerticalResolution(javacast(“int”,200))>
<cfset ipo.setOnePagePerSheet(javacast(“boolean”,true))>
<cfset ipo.setImageFitToPage(javacast(“boolean”,true))>
<cfset imageFormat=createObject(“java”,“com.aspose.cells.ImageFormat”).getPng()>
<cfset ipo.setImageFormat(imageFormat)>
<cfset sr=createObject(“java”,“com.aspose.cells.SheetRender”).init(ws,ipo)>
<cfset sr.toImage(0,tempPNGFile)>
I would appreciate it if you can tell me if you replicate the same results I am seeing. Thank you.