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

Feat: Add custom id to Iframe body #785

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

joyal007
Copy link

@joyal007 joyal007 commented Feb 3, 2025

Added optional argument iframeBodyId to useReactToPrint which will set id from iframe body.

This is potential fix for #784

@MatthewHerbst
Copy link
Owner

Thanks, I'll play around with this later tonight

@MatthewHerbst
Copy link
Owner

Is the goal to actually style the body of the document, or do you just need an element with an id of "body" to exist? For example, if you wrapped your content being printed in a <div id="body"> does that solve the issue?

@joyal007
Copy link
Author

joyal007 commented Feb 3, 2025

Yes it's also a fix, but i felt it's little inconvenient naming id='body' for a div + i need to do this for all the component that i wish to generate pdf.

Also we already have an body element with id='body'.

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

Successfully merging this pull request may close these issues.

2 participants