Remove White Spaces from the Data before Rendering to Image
Contents
[
Hide
]
Sometimes, you need to present worksheet images in applications or web pages. For example, you might need to insert an images into a Word document, a PDF file, a PowerPoint presentation or some other document. Basically, you want to render a worksheet as an image so that it can be pasted into other applications. Aspose.Cells APIs allows you to convert Microsoft Excel worksheets to images.
The SheetRender class is capable of converting a worksheet to an image file with any specified attributes, for example, image format, paginated sheets, etc. Several image formats are supported, including BMP, GIF, JPG, TIFF, and EMF.
When you use the sheet-to-image feature, the output image has white/blank space, that is, a border, around it by default. You can remove this. Set the top, left, bottom, and right page setup margins for the source worksheet to 0 and specify ImageOrPrintOptions attributes accordingly.