Aspose pdf using cells

Hi All,

I am generating pdf files using Aspose cells for Java.

I am not able to set the zoom manually while converting the excel to PDF format.

If I use the below code

pageSetup.setOrientation(PageOrientationType.LANDSCAPE);

pageSetup.setZoom(100);

By default PDF file is taking 71.7 % zoom

And If I use the below code

pageSetup.setOrientation(PageOrientationType.PORTRAIT);

pageSetup.setZoom(100);

By default PDF file is taking 143% zoom .

It is taking the default zoom irrespective of zoom we are setting manually in both the cases. Please find the attached PDF reports for your reference.

Please let us know how can we make pdf version more readable.

Hi Abhinav,

Thanks for your posting and using Aspose.Cells.

Setting the workbook zoom to some large number will not have any effect on the generated pdf. You can check it in MS-Excel and setting the zoom to some large values like 160% and then check it in MS-Excel Print Preview, you will see that Excel zoom does not have any effect on the MS-Excel Print Preview.

Aspose.Cells generates the PDF same as it is shown in MS-Excel Print Preview.

Similarly, you cannot control (set) Adobe Acrobat PDF Zoom size using Aspose.Cells API.

Hi,

Thanks for the quick response.

Would you recomend anything on the attached reports. Sample.xls to get Sample.pdf.

I was wondering what should be the best way to get the adjustment of excel, so that it can be converted to pdf.

Attached are the required reports.

Hi Abhinav,

Thanks for your posting and using Aspose.Cells.

You can try the following code. It will print all columns in a single page.

Java


String filePath = “F:\Shak-Data-RW\Downloads\Sample.xlsx”;


Workbook workbook = new Workbook(filePath);


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


worksheet.getPageSetup().setFitToPagesWide(1);


workbook.save(filePath + “.out.pdf”);