Open print preview window by javascript

Asked

Viewed 848 times

0

I would like to know how to open this IE print preview window by javascript, I need a button that opens this window, without I need to go to it by settings.

inserir a descrição da imagem aqui

1 answer

1


Use the method print of the object window.

window.print() 

If you want to link to the click of a button would look like this:

<input type="button" name="imprimir" value="Imprimir" onclick="window.print();">
  • I used, but then it already opens the window for printing, I wanted to open this pre preview before, if possible.

  • It would have an example link?

  • 1

    No, just going by right click on IE, there is the option to pre preview. But from what I researched here it seems that there is no way. But thank you so much!

  • In other browsers like Chrome for example this function opens the print screen, but the file opens beside to preview, I do not know how other browsers behave

Browser other questions tagged

You are not signed in. Login or sign up in order to post.