int JavaScript:window.print()如何打印为图像 [英] int JavaScript:window.print() how to print as image

查看:198
本文介绍了int JavaScript:window.print()如何打印为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

    <style type="text/css" media="screen, print">
        .printpreview p.Normal{
        text-align:justify;
        font-family:Arial !important;
        font-size:14px !important;
        }
        .printpreview p.Normal font
        {
        font-size:14px !important;
        }
        .printpreview { padding-right:25px;color:#000; font-size:14px !important;
                        background:url(../../Content/images/print-bg.jpg) repeat;

                        }
        .print-logo{
        background:url(../../Content/images/logo-printpage.jpg) no-repeat;
        text-indent:-9999px;
        height:40px;
        width:245px;
        float:left;
        display:block;
        position:absolute;
        top:31px;
        left:30px;
       }
       .user-name
       {
           float:right;
           font:bold 14px arial;
           position: absolute;
           right: 33px;
           top: 34px;
       }

     .clear {
    clear:both;
}

    </style>
</head>
<body onload="JavaScript:window.print();" style="background:none;">

    <div class="printpreview">
    <div class="print-logo">logo</div>
    <div class="user-name">@ViewData["username"]</div>
   <div class="clear"></div>
     <div style="margin-top:80px;">
      @Html.Raw(HttpUtility.HtmlDecode(Model.Ordinance1))
      </div>
   </div>
</body>







请帮助我




pls help me

推荐答案

你需要使用Canvas。

参考这个帖子: http://stackoverflow.com/questions/9075792/save-export-image-file-from-html-content [ ^ ]



-KR
You need to use Canvas.
Refer this thread: http://stackoverflow.com/questions/9075792/save-export-image-file-from-html-content[^]

-KR


这篇关于int JavaScript:window.print()如何打印为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆