Regarding zoom issue while converting excel to PDF

Hi,

I am converting excel to PDF . In the PDF it is not taking the zoom which I put manually. Please find the attached excel and PDF . Below is the code I am using .

Worksheet sheet = workbook.getWorksheets().get(0);

PageSetup pageSetup = sheet.getPageSetup();

//Setting the orientation to Portrait

pageSetup.setOrientation(PageOrientationType.PORTRAIT);

pageSetup.setLeftMargin(HALF);

pageSetup.setRightMargin(HALF);

pageSetup.setTopMargin(ONE);

pageSetup.setZoom(200);

//Setting the printing order of the pages to over then down

pageSetup.setOrder(PrintOrderType.OVER_THEN_DOWN);

pageSetup.setFitToPagesTall(0);

if(noOfColumns>8)

{

pageSetup.setFitToPagesWide(noOfColumns/8);

}

sheet.autoFitRows();

Hi Kishore,


Thank you for contacting Aspose support.

If you are referring to the Zoom dropdown in Adobe Reader interface (please see the attached snapshot) then it cannot be adjusted with Aspose.Cells APIs. However, you can render the contents of any spreadsheet to PDF format while zooming the contents of the worksheet at any specified factor. You have to set the PageSetup.Zoom property as you are currently doing in your code snippet. Please note, the PageSetup.Zoom property will not take effect if you are setting any of the FitToPagesTall or FitToPagesWidth properties. Please try the case by commenting out the aforesaid statements in your code, and you will notice that the contents of the spreadsheet are rendered magnified.