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

unable to add table to footer #324

Open
nmorgol opened this issue Mar 7, 2023 · 0 comments
Open

unable to add table to footer #324

nmorgol opened this issue Mar 7, 2023 · 0 comments

Comments

@nmorgol
Copy link

nmorgol commented Mar 7, 2023

ℹ Please fill out this template when filing an issue.
All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info.

What did you do?

ℹlayout.margin.bottom = 0(or other >0)
document.add(.footerCenter, table: footerTable) => get nothing

layout.margin.bottom = -10(or other <0)
document.add(.footerCenter, table: footerTable) => footerTable at the next page

What did you expect to happen?

ℹexpected to get a table at the bottom of the page

What happened instead?

ℹlayout.margin.bottom = 0(or other >0)
document.add(.footerCenter, table: footerTable) => get nothing

layout.margin.bottom = -10(or other <0)
document.add(.footerCenter, table: footerTable) => footerTable at the next page

TPPDF Environment

TPPDF version: ℹ2.4.0
Xcode version: ℹ14.2
Swift version: ℹ5

Demo Code / Project

ℹlet document = PDFDocument(layout: layout)
document.background.color = .white

    let footerTable = PDFTable(rows: 3, columns: 3)
    let lineStyleFooter = PDFLineStyle(type: .full, color: UIColor.red, width: 2)
    let cellStyleFooter = PDFTableCellStyle(colors: (fill: UIColor.blue, text: UIColor.black),
                                            borders: PDFTableCellBorders(left: lineStyleFooter, top: lineStyleFooter, right: lineStyleFooter, bottom: lineStyleFooter), font: .init(name: "Arial-BoldMT", size: 18.2) ?? Font.boldSystemFont(ofSize: 76) )
    
    for i in 0...2{
        for j in 0...2{
            footerTable[i,j].content = try? PDFTableContent(content: "123123123")
        }
    }
    
    document.add(.footerCenter, table: footerTable)

ℹ We need a fully compilingPDFDocument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant