Print reports with React

0

Good morning, I'm practically new with this technology and well I'm doing my first steps. I am with a project for my company and I would like to know if it is possible to print certain reports directly to the printer by react.

Thanks for your help. Greetings.

    
asked by Oscar Mañas Garcia 15.09.2017 в 11:24
source

1 answer

0

The most you can do is ask the browser to open the print window for the user with

window.print();

With what will be printed the document that you have open in that window / tab.

And to make it look nice, you can define CSS specifically for the printer. You do not have to see the same on paper as on the screen if you do not want to (you can hide images, remove colors to save ink, change the width so you do not have to climb ...) by using

@media print {
  /*css aquí */
  body {
     ...
  }
}
    
answered by 15.09.2017 / 11:44
source