G
G
Grigory Dikiy2017-04-04 12:10:18
JavaScript
Grigory Dikiy, 2017-04-04 12:10:18

Printing in React+Electron?

Good day! There is a simple task: to print the data passed in the form of HTML with the standard ability to preview the printed file provided by chrome. It turned out that everything is not so simple, the fact is that the new window does not have a document property, which is why the data cannot be written there:

print(){
    let win = window.open();

    console.log(win);
  }

f35fac58057340329c54ca61274b0b33.png
And you need something like this:
let win = window.open();
win.document.write('Some Data');
win.print()
win.close()

Any ideas? I would be grateful for help

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question