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

Free Support Forum - aspose.com

Format Problem with xls to pdf generation


I have a little problem with page size. If I convert one xls to pdf which is bigger than the standard page width pdf is formatting this into two pages. (Last columns will appear in second page of pdf).How can fit that into one page.

And you can see some column interchange also happend in pdf.

Please find the attachment for xls I have used and generated pdf .

Please reply soon

Thanks & regrds



I think there was a wrong line in my code snippet, please correct it as follows:


//Accessing the first worksheet in the Excel file

Worksheets worksheets = workbook.getWorksheets();

Worksheet sheet = worksheets.getSheet(0);

PageSetup pageSetup = sheet.getPageSetup();

//Setting the number of pages to which the length of the worksheet will be spanned


//Setting the number of pages to which the width of the worksheet will be spanned



And for the issue with the last column being placed in center of the page, it is the issue of Pdf, We have posted this problem to the Pdf team. Hopefully, they will resolve it soon.

Thank you.

Hi Amjad

Very very thanks for your quick respose.That problem solved.Pdf problem I also already discussed with Aspose.pdf team.I need to generated xls from the data taken from database using java .I am working on that (going through the document which is provided by Aspose site).May be I need more help for that once I start implementation.

Once again thanks,really you people are giving very fantastic service