Closed
Description
Can we control all of the window parameters? I think this will be useful.
Actually I only need fullscreen property but controlling the other properties could be good.
I think we could make an object property (windowParams) and override it.
class Example extends React.Component {
render() {
return (
<div>
<ReactToPrint
windowParams={{
fullscreen: 'yes',
}}
trigger={() => <a href="#">Print this out!</a>}
content={() => this.componentRef}
/>
<ComponentToPrint ref={el => (this.componentRef = el)} />
</div>
);
}
}
And we could convert this object to string.
index.js
const windowParameters = {
status: 'no',
toolbar: 'no',
scrollbar: 'yes',
...windowParams
}
//Need a good stringify algorithm or npm project
let printWindow = window.open("", "Print", windowParameters.stringifyProperly(), "false");
What do you think?
Metadata
Metadata
Assignees
Labels
No labels