Using Aspose.Cells for Python via Java.
Saved spreadsheet shows the Header/Footer option to Align with page margins is enabled. Saving the spreadsheet as a PDF using Excel results in the correct Footer appearance. Saving the spreadsheet as a PDF using Aspose.Cells results in overlapping text in the Footer.
Disabling the “Align with page margins” and saving as a PDF using Excel results in the same overlapping text seen when saved using Aspose.Cells.
@akoenen
Based on the detailed information you provided, we have created a sample file, and through the result file, we can observe the situation of text overlap. This situation occurs due to setting too much data in the position of the footer. If you export file to PDF via Excel, you will also observe this phenomenon. Please refer to the attachment (254.6 KB).
If you still have any questions or confusion, please provide your sample file and executable test code, and we will check it soon.
@John.He
Thank you for your quick reply. In reviewing the attachment, i found the included sample.xlsx spreadsheet did not have the margins set per my original post. After setting the sample.xlsx margins to match my write-up, the PDF created by excel does not have overlapping text. The picture does overlap, but that is not an issue in my case. When the PDF is created with Aspose, the text still overlaps.
Sample attached.
The script assumes the sample.xlsx file will be in the same directory as aspose_test.py. footer_margins.zip (88.6 KB)
I tested your scenario/case using your template Excel file with latest version of Aspose.Cells for Python via Java, it works Ok and same as what MS Excel renders. Please try Aspose.Cells for Python via Java v23.12:
Could you please zip and attach the output PDF file by Aspose.Cells for Python via Java v23.12? Also, what display setting (it should be 100%) is set on your machine (os - where you are processing the sample code)? We will check it soon.
The font used in footer is different between Aspose.Cells generated pdf and Excel generated pdf you shared. Please install “Calibri” font on your RHEL device.
Note: To get consistent output with Excel, the correspoding fonts used in the source xlsx file should be installed.
The paper size is “A4” in the source xlsx file, however, the paper size in the Excel generated pdf you shared is “Letter”(This may be caused by the set that the default paper size of your default printer is “Letter”). It is not right.
Please check the pdf files generated by Aspose.Cells and Excel on my side. They are consistent and text is overlapped a little in the footer. output_little_overlapped.zip (273.4 KB)
Thanks for the extra information.
After saving the PDF with the same font and paper size, i am seeing consistent results between Excel and Aspose.Cells.