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

Image in header with 0 margins along with text in header with standard margins #317

Open
brendand opened this issue Dec 15, 2022 · 0 comments

Comments

@brendand
Copy link
Contributor

What's the best way to get a header image to use up. the entire space of the header part of the page, ignoring the margins, while some text and a line separator in the header respects the margins?

It seems to work for the first page, but subsequent pages the image I'm adding is being indented.

image

I'm using the following code to set the margins to 0 and the indentation to whatever the user has specified.

let pdfImage = PDFImage(image: image)
document.add(headerPosition, image: pdfImage)
document.add(headerPosition, space: 20)
document.layout.margin = EdgeInsets(top: 0, left: 0, bottom: reportSettings.marginBottom, right: 0)
document.set(indent: reportSettings.marginLeft, left: true)
document.set(indent: reportSettings.marginRight, left: false)
document.set(.headerLeft, indent: reportSettings.marginLeft, left: true)
document.set(.headerLeft, indent: reportSettings.marginRight, left: false)
document.set(.footerLeft, indent: reportSettings.marginLeft, left: true)
document.set(.footerLeft, indent: reportSettings.marginRight, left: false)
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