We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Facing issue when converting excel to PDF

Hi,

I am converting excel to PDF . I want 8 columns in a page .I am using below code to achieve this.
pageSetup.setFitToPagesTall(0);
if(noOfColumns>8)
{
int remainder=noOfColumns%8;
int setNoOfPages=noOfColumns/8;
if(remainder>0)
{
setNoOfPages=setNoOfPages+ONE;
}
pageSetup.setFitToPagesWide(setNoOfPages);
}

Ex:- When noOfColumns=199 then setNoOfPages=25 so report should be generated in 25 pages each should have 8 columns and last one should b 7 columns . But in the report it is generating randomly please find the attached report and also I want the data should be visible properly with out adjusting the zoom.
Please suggest me.

Hi,


Thanks for providing us PDF document.

Well, FYI, Aspose.Cells (similar to built-in MS Excel renderer for generating PDF) renders PDF file based on what is shown in the print preview of MS Excel for different sheets. If you could achieve your task in Ms Excel manually, you may do it via Aspose.Cells APIs. We require kindly create a sample Excel file with data that you may manually create in MS Excel with your desired PageSetup settings, save the file and post us here, we will check and test your issue on our end.

Thank you.

Hi,

Is it possible to display 8 columuns in each page in PDF while converting it from excel.

Hi,


Well, it depends on the columns’ data in the cells and their width etc., if you you have less data and columns’ width is minimal, you would get even more than 8 columns on a single page, you may make use of PageSetup’s Rows/Columns to repeat at the top option(s), FitToPagesWide options or other options etc.

As I requested you earlier, you should try to implement your requirements in Ms Excel manually based on your data and contents of the file. If you could achieve your task in Ms Excel manually, you may do it via Aspose.Cells APIs easily and the rendered PDF file would be same as per your Excel file.

Thank you.