Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

window.print() prints blank page

Tags:

javascript

I get blank page while printing. The border(it may be the frame) is printed. But not the content inside the frame. if we manually print the new page it is getting printed correctly. Why this happen?

var printwindow = window.open('', '', 'fullScreen=no');
printwindow.document.write('<iframe id="docPrint" onLoad="window.print()" width="100%" height="100%" src="http://localhost:8080/hiring/docs/Keneth _1340800082258/Keneth _resume_1340800082258.pdf"></iframe>');
like image 228
Sarika.S Avatar asked Oct 28 '25 07:10

Sarika.S


1 Answers

That is not possible with JavaScript.

I don't know which language your server is written in, but it may be possible to make your PDF auto print.

like image 170
Raab Avatar answered Oct 29 '25 22:10

Raab



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!