We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

XlsIO excel document silent print (as Image) and fit columns

Good day!
I need the silent print the excel document. I have used sheet.ConvertToImage() method.
But.. I need to fit all columns to the one screen (var lastColumn = sheet.UsedRange.LastColumn + 1). So I need to know the row count on each print page (Image). E.g. 10 rows on first page sheet.ConvertToImage(1,1,10,lastColumn), 12 rows on second page sheet.ConvertToImage(11,1,22,lastColumn).. etc.
How can I calculate this row count per each print page?

1 Reply

DB Dilli Babu Nandha Gopal Syncfusion Team December 22, 2015 11:44 AM UTC

Hi Sychev,

In XlsIO, you can explicitly convert the range of the worksheet using ConvertToImage( int firstRow, int firstColumn, int lastRow, int lastColumn ) method. This method will return a single image for the entire specified range. To convert an image page-wise, you must create a custom method which calculates number of rows to be converted based on row height so that array of images will be converted for entire range.
Please refer our UG Documentation for Worksheet to Image conversion from the below link.

Documentation link: http://help.syncfusion.com/file-formats/xlsio/conversions#convert-worksheet-to-image

Please let us know if you have any concerns.

Dilli babu.

Live Chat Icon For mobile
Up arrow icon