Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.




This pull request enhances the header and footer functionality in the OpenPDF library, focusing on supporting non-text elements (such as images and tables) in footers, and improving layout flexibility. The changes introduce new APIs and internal mechanisms to manage special content in headers/footers, update how padding is handled, and ensure correct rendering and spacing for these elements. Additionally, there are minor code cleanups and refactorings for better readability.
Header/Footer Special Content and Layout Enhancements:
specialContentlist and related methods in theHeaderFooterclass (addSpecialContent,getSpecialContent). This enables images and tables to be queued and rendered as part of the footer. [1] [2]addPaddingmethod to accumulate space requirements for special content. [1] [2]flushSpecialinPdfDocumentto render non-text footer content (images and tables) at the correct position, handling alignment and spacing.addDelayanddelayTableAdditionmethods inPdfDocumentto defer placement of images and tables until the footer is rendered, ensuring correct layout and spacing.ruy(relative upper y-coordinate) property toRectangleand related getter/setter to help position special content relative to the footer. [1] [2]Footer Rendering and Document Flow Adjustments:
isDoFooterflag). If so, images and tables are delayed and added to the footer's special content instead of being rendered immediately. [1] [2]paragraph()method inHeaderFooterto prevent unwanted newlines when adding aParagraphto anotherParagraph, ensuring clean header/footer text rendering.Internal Refactoring and Code Quality:
setTableWidthmethod for reuse and clarity.PdfDocument(e.g., initialization ofhScaleandscolor). [1] [2]HeaderFooterfor better code readability and maintainability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]These changes collectively enable more complex and visually rich headers and footers, particularly for use cases that require images or tables in page footers.## Description of the new Feature/Bugfix
Describe here how you fixed the bug, or implemented the new feature.
Related Issue: #
Unit-Tests for the new Feature/Bugfix
Compatibilities Issues
Is anything broken because of the new code? Any changes in method signatures?
Your real name
Please specify your full name here, so that we can verify your identity.
If you have a conflict of interest describe this here also.
Testing details
Any other details about how to test the new feature or bugfix?