Comments (5)
@MatthewHerbst thanks for getting back to me and for the nice work on the malformed links ;)
I don't think it is possible to change the css of the stuff being printed once you're in the browser dialog. Say you're trying to size an svg to fit nicely on the print window, it would be nicer to do that in a fake preview mode where you can play with the css in the devtools as opposed to opening and closing the print preview dialog over and over as you tweak the css. Does that make sense?
Maybe there is already a way to get what I want but I couldn't find one.
from react-to-print.
What's wrong with the preview dialog the browser gives you?
from react-to-print.
Ah, got it. Hmm. Seems like this would be a good chance to investigate using React Portals, though that would require us forcing newer React 16 versions which I personally wouldn't love since my company is still on 15 😢 but maybe we could make it in a way where it just does a noop if you're still on a version that doesn't have portals?
from react-to-print.
@MatthewHerbst or we could just continue using the iframe approach? I think my codesandbox illustrates how that approach could work. It definitely needs some work to make it nicer.
from react-to-print.
That works too! Just been reading about all the shiny things in React 16, and, they are shiny! Once concern: assuming the iframe should work and not just be static content, will app JS continue to function normally in iframes in all scenarios? I think there are ways to set it up properly, just have to be careful. Here's an example on SO: https://stackoverflow.com/questions/34743264/how-to-set-iframe-content-of-a-react-component
from react-to-print.
Related Issues (20)
- Page break wide content HOT 3
- Superscripts <sup/> and subscripts <sub/> HOT 1
- react-to-print custom print html content dev vs prod discrepancy HOT 4
- [BUG] [TEMPORARY FIX] - Print container on Chrome + MUI is hiding `Header and Footers` option as default behavior HOT 5
- The FOOTER to only display at the LAST PAGE HOT 3
- codesandbox examples are not loading HOT 2
- onAfterPrint is called before print iframe appears HOT 1
- On mobile devices are not truncated accordingly ref HOT 1
- Add Border to every Page HOT 4
- Add dynamic colors to print function HOT 1
- How to check that the user click on Save in `onAfterPrint`? HOT 2
- getting Supplied Data is not a valid base64-String jsPDF.convertStringToImageData erorr while directly downloading image HOT 1
- Border top and bottom HOT 1
- Save as PDF hangs in print view HOT 1
- Blank PDF when trying to generate in production. HOT 2
- How should i handle large data to print? HOT 8
- Why does it render different content when in im browsing in mobile HOT 3
- Blank Page while printing after a certain period of time HOT 9
- How to add style using PageStyle prop, without it overriding component’s style HOT 5
- Warning: findDOMNode is deprecated outside StrictMode. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-to-print.