Reputation: 221
I am using react and electron. I need to print some generated HTML in react app when I pus click on button:
<FlatButton label='Print' primary={true} onTouchTap={this.props.print} />
But the problem is, that new window in electron don't have document property, so I can't write there some HTML. New Window i need to preview output data:
print(){
let win = window.open();
console.log(win);
}
new window properties I need something like that
let win = window.open();
win.document.write('Some Data');
win.print()
win.close()
How can I resolve this problem? Any ideas?
Upvotes: 2
Views: 2713
Reputation: 221
I have been resolved the problem. The solution for me: create the print view component and just use window.print() to print the data.
Upvotes: 1