In our project we are using Aspose Cells for Java to convert excel into PDF.
Problem we are facing is no matter how long excel it’s getting converted into 1 page PDF.
Basically we want excel content to split across multiple pages depending on page size instead of shrinking text and fitting into only one page PDF.
Please let us know what settings we can use to achieve this formatting while generating PDF from excel.
Hi,
Thanks for reply we tried above settings but it’s not working in our case.
Just to explain workflow
1. We use template excel file
2. Populate data in excel file (create extra rows)
3. Save excel file as PDF
Do we need to set anything specific in PDF options?
PdfSaveOptions saveOption = new PdfSaveOptions();
saveOption.setCalculateFormula(true);
saveOption.setOnePagePerSheet(false);
Please let us know if we can try any other settings.
Hi,
Thanks for Reply.
We were able to generate multiple page PDF after adding Page Set Up attribute.
However in all cases it’s generating 2 Page PDF even though content can fit on one page.
Attached excel and PDF with this post.
Please review and let us know if any solution is available to resolve this issue.
vgadewar:
.... it's generating 2 Page PDF even though content can fit on one page.
Attached excel and PDF with this post.
Please review and let us know if any solution is available to resolve this issue.Well, as I told you before, by default, Aspose.Cells renders PDF file based on PageSetup settings or based on what is shown in print preview in MS Excel for the sheet(s). For confirmation, you may check to open the Excel file into your MS Excel manually and see the print preview of the sheet, you would see the content in two pages too. This is not an issue with the product by any means, because, the component renders to PDF format based on the print preview of MS Excel which it should (you may also try to convert the Excel file to PDF manually in MS Excel and will also see two pages for your contents.)For your needs, I think you may try to specify PdfSaveOptions.setOnePagePerSheet(true) for your needs here.PdfSaveOptions saveOption = new PdfSaveOptions();
saveOption.setOnePagePerSheet(true);workbook.save(stringFileName, saveOptions);Let us know if you still have any confusion or issue.Thank you.