1function closeSVGWindow(targetWindow) { 2 targetWindow.document.write('<h3>SVG file printed. Please close this window.</h3>'); 3 targetWindow.close(); 4} 5 6function svgembed_printContent(path) { 7 // Open window and load content 8 var svgembed_print = window.open('', '_printwindow', 'location=no,height=400,width=600,scrollbars=yes,status=no'); 9 svgembed_print.document.write('<html><head></head><body><img src="' + decodeURIComponent(path) + '" ' + 10 'style="width:100%;height:100%"></body></html>'); 11 svgembed_print.document.close(); 12 13 // Print 14 setTimeout(function(){ svgembed_print.window.print(); }, 1000); 15 setTimeout(function(){ closeSVGWindow(svgembed_print); }, 2000); 16} 17 18function svgembed_onMouseOver(object_id) { 19 document.getElementById(object_id).className = document.getElementById(object_id).className + ' svgembed_print_border'; 20 return false; 21} 22 23function svgembed_onMouseOut(object_id) { 24 document.getElementById(object_id).className = document.getElementById(object_id).className.replace(' svgembed_print_border', ''); 25 return false; 26} 27