Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank space after footer if SpaceBefore is set #41

Open
kobruleht opened this issue Oct 15, 2023 · 2 comments
Open

Blank space after footer if SpaceBefore is set #41

kobruleht opened this issue Oct 15, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@kobruleht
Copy link

kobruleht commented Oct 15, 2023

Expected Behavior

Footer text should appear in bottom of page

Actual Behavior

There is empty space between footer text and end of page

unexpectedblankspaceafterfootertext.pdf

Steps to Reproduce the Behavior

Run

emptyspaceafterfooterifSpaceBeforeIsUsed.zip

Code

        static Document CreateDocument()
        {
            var document = new Document { };
            var Section = document.AddSection();
            Section.PageSetup.PageWidth = "210mm";
            Section.PageSetup.PageHeight = "297mm";
            Section.PageSetup.TopMargin = 0;
            Section.PageSetup.BottomMargin = Unit.FromCentimeter(3);
            Section.PageSetup.FooterDistance = 0;
            Section.PageSetup.HeaderDistance = 0;
            for (int i = 0; i < 77; i++)
                Section.AddParagraph("paragraph " + i);
            var par1 = Section.Footers.Primary.AddParagraph("Unexpected blank space after footer text");
            par1.Format.SpaceBefore = Unit.FromCentimeter(2);
            par1.Format.SpaceAfter = 0;
            return document;
        }

@ThomasHoevel
Copy link
Member

I'll investigate this when I find the time.
It's a pity you removed too much from the IssueSubmissionTemplate, thus destroying the purpose of the template.

@ThomasHoevel
Copy link
Member

Footers are bottom-aligned. SpaceBefore makes no sense for the first paragraph of the footer.
However, it seems that SpaceBefore is not handled correctly for the first paragraph of a footer. While SpaceBefore should be ignored completely for the first paragraph of the footer, it is possibly included when calculating the height of the footer, thus resulting in space after the footer, not before it.

@ThomasHoevel ThomasHoevel added the bug Something isn't working label Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants