对于网页和打印的印地语字体,请使用以下 CSS:
@font-face {
font-family: 'Kruti Dev';
src: url('../../Content/CustomCSS/Kruti Dev 010.ttf') format('truetype')}
.KrutiDev_hindi_text {
font-family: Kruti Dev !important;
font-size: 18px !important;}
将KrutiDev_hindi_text
类添加到要应用印地语字体的 div,并在打印函数中添加对此 CSS 的引用,即strid
您要打印的 =div id。
打印功能:
function CallPrint(strid) {
var panel = document.getElementById(strid);
var printWindow = window.open('', '', 'letf=100,top=100,width=600,height=600');
printWindow.document.write('<html><head><meta charset="utf-8" /><title> </title>');
printWindow.document.write('</head><body >');
printWindow.document.write('<div class="container-fluid">');
printWindow.document.write(panel.innerHTML);
printWindow.document.write('<\/div>');
//printWindow.document.write('<link href="/Content/bootstrap.css" rel="stylesheet" />');
printWindow.document.write('<script src="/Scripts/jquery-1.9.1.min.js"><\/script>');
//printWindow.document.write('<script src="/Scripts/bootstrap.min.js"><\/script>');
printWindow.document.write('<link href="/Content/BhardwajCustom.css" rel="stylesheet" />');
printWindow.document.write('<style><\/style>');
printWindow.document.write('</body>');
printWindow.document.write('</html>');
printWindow.document.close();
//printWindow.print();
setTimeout(function () {
printWindow.print();
}, 100);
return false;
}