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

Header & Footer moves up after PDF file is generated #18

Open
sharathm89 opened this issue Jul 21, 2023 · 4 comments
Open

Header & Footer moves up after PDF file is generated #18

sharathm89 opened this issue Jul 21, 2023 · 4 comments

Comments

@sharathm89
Copy link

sharathm89 commented Jul 21, 2023

Header and Footer moves up after the PDF file is generated. This doesn't happen in website but only in PDF.

Note: This issue starts when Table overflows to the next page.

Below is the github repo link which demonstrates the issue. (checkout the readme file)

Repo Link

Observe the video where header slightly moves up.

Screen.Recording.2023-07-20.at.11.13.10.PM.mov

test-header.pdf

@sharathm89
Copy link
Author

sharathm89 commented Jul 21, 2023

@PejmanNik Sample code setup is done in codesandbox...

https://codesandbox.io/s/report-web-app-mm4l5l?file=/src/views/table/index.js

Try to do the print preview and download pdf and keep observing the header in each page. At the end of the pdf the header shifts slightly up which causes issues for other components. (more pages more header shifts happen)

Direct Output link from codesandbox

@sharathm89 sharathm89 changed the title Header moves up after PDF file is generated Header & Footer moves up after PDF file is generated Jul 22, 2023
@PejmanNik
Copy link
Owner

this is an interesting issue🤦‍♂️I think this is an issue in the chromium (or specifically in PDFium) project. can you please try to create the same header pattern with pure HTML and save it to PDF and check the result?

@PejmanNik
Copy link
Owner

it is related to Page size, reducing the page height can solve the issue: https://codesandbox.io/s/report-web-app-forked-stz333?file=/src/App.js

I'm not sure why, but Chromium Save to pdf use different dimension for page sizes

@sharathm89
Copy link
Author

sharathm89 commented Jul 23, 2023

Specifying the exact dimensions works dimension={{ height: "295mm", width: "210mm" }}

Thanks 🙏

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

2 participants