HFAlignMargins Setting not respected in Footer PDF

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.

Page Margins:
Top: 1.75
Left: 0.45
Right: 0.3
Bottom: 0.75
Header: 0.25
Footer: 0.3

Footer Left Section Text:
&[Picture]
UU Eeeell Clssssssssssss: SSS SSSS 9S999

Footer Center Section Text:
EE Eeeeeeee: Iiiii EW: 000 Revision Date: 2023-06-15
Report Generated at &[Date] &[Time]

Footer Right Section Text:
Eeeeee Ssssss Eeeeee: 000000
Page &[Page] of &[Pages]

@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)

@akoenen,

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:

Let us know with details if you still find the issue with latest version of the API.

i have updated from version 22.5 to 23.12 and am still seeing the same problem with the sample i provided in my earlier post.

i’m not sure what further detail i can provide to assist.
This is the footer that aspose produces:
image.png (19.3 KB)

This is the footer that Excel produces:
image.png (18.3 KB)

As you can see, the text does not overlap in the footer created by Excel.

@akoenen,

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.

footer_margins_v23_12.zip (15.0 KB)

The machine running the sample code is a RHEL 7.5 device. It does not have a display scaling setting.

@akoenen ,

  1. 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.
  2. 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.

@akoenen
Thank you for your feedback. I’m glad your issue has been resolved. If you have any questions, please feel free to contact us.