File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
KB-Samples/PrintingHTML/wwwroot Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 11window . print = function print ( id ) {
2- var printContent = document . getElementById ( id ) ;
2+ var printContent = document . getElementById ( id ) . innerHTML ;
33 var WinPrint = window . open ( '' , '' , 'width=900,height=690' ) ;
4- WinPrint . document . write ( printContent . innerHTML ) ;
4+ // Apply required styles (e.g., Syncfusion theme or custom CSS)
5+ WinPrint . document . write ( '<link rel="stylesheet" type="text/css" href="_content/Syncfusion.Blazor.Themes/bootstrap5.css">' ) ;
6+ WinPrint . document . write ( printContent ) ;
57 WinPrint . document . close ( ) ;
6- WinPrint . focus ( ) ;
7- WinPrint . print ( ) ;
8- WinPrint . close ( ) ;
9- }
8+ WinPrint . onload = function ( ) {
9+ setTimeout ( function ( ) {
10+ WinPrint . focus ( ) ;
11+ WinPrint . print ( ) ;
12+ WinPrint . close ( ) ;
13+ } , 100 ) ;
14+ }
15+ } ;
You can’t perform that action at this time.
0 commit comments