-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Print title and orientation issue on firefox #391
Comments
The title not working is being tracked in #321 Any chance you can make a working codesandbox with your code that replicates the orientation issue? Everything in your code above looks ok but hard to debug/play around with an image |
Here is codesandbox url, I want to use lg grid system which is working on chrome, edge but not in firefox |
Another query related orientation is , how to set default orientation landscape in firefox as @page {size : landscape } is not supported in firefox? |
Apologies for not responding, I've had to focus on work the past few weeks. I hope to have time to get to these issues this weekend |
I have similar issue with Firefox, that regardless of documentTitle prop or explicity setting document.title, title displayed in "save as" window is always "blank.pdf". As react-to-print creates iframe for printing, I assumed, that Firefox takes title from html inside this iframe.
With this code, in Chrome I have title "default document title", but in Firefox, title is "iframe innerHtml title". |
Thanks for the research @pgarr! |
After a lot of research and trial/error I've got the page title working for the major desktop browsers (Chrome, Firefox, Safari). I'll be making a release tonight with these changes, here is what it ended up needing to be: if (documentTitle) {
// Print filename in Chrome
target.ownerDocument.title = documentTitle;
// Print filename in Firefox, Safari
if (target.contentDocument) {
target.contentDocument.title = documentTitle;
}
} I'll be doing research into mobile browsers later this week, but I believe the above should fix the majority use cases. |
* Add `logMessages` function, fix small bug * Style examples, add example using functional component to print * Added style tip about page orientation * Added functional ComponentToPrint example, added a styling pitfall * Add pitfall example regarding printing component arrays (#323) * Upgrade all `devDependencies` * Change class-only error to link how to use functional components * Fix print to PDF filename not working in all major browsers #391 * Add to README about known issues when printing from mobile WebViews
Published in |
* Add `logMessages` function, fix small bug * Style examples, add example using functional component to print * Added style tip about page orientation * Added functional ComponentToPrint example, added a styling pitfall * Add pitfall example regarding printing component arrays (#323) * Upgrade all `devDependencies` * Change class-only error to link how to use functional components * Fix print to PDF filename not working in all major browsers MatthewHerbst/react-to-print#391 * Add to README about known issues when printing from mobile WebViews
In mozilla firefox print title and page landscape orientation is not working while It's working in microsoft edge and google chrome
Here are screenshot for chrome, edge and mozella
and here is my code
The text was updated successfully, but these errors were encountered: