jquery - jquery打印设置每张纸的页数
问题描述
我正在做一个 asp.net 项目。在我当前的页面中,我需要打印一个图像,我使用 jquery 来打印这个,我的代码如下。
function VoucherSourcetoPrint(source) {
var width = $("#imgWidth").val();
var height = $("#imgHeight").val();
return "<html><head><script>function step1(){\n" +
"setTimeout('step2()', 10);}\n" +
"function step2(){window.print();window.close()}" +
"\n<\/script></head><body onload='step1()'>\n" +
"<img src='" + source + "' style='width: " + width + "px; height: " + height + "px;' /></body></html>";
}
function VoucherPrint(source) {
source = $('#imgCtrl').attr('src');
Pagelink = "about:blank";
var pwa = window.open(Pagelink, "_new");
pwa.document.open();
pwa.document.write(VoucherSourcetoPrint(source));
pwa.document.close();
}
如您所见,高度和宽度取自文本框。调用 VoucherPrint 函数后,它显示如下打印对话框,
所以我正在努力实现一些目标,
- 使用代码删除页眉和页脚
- 使用代码增加打印数量,即每页的图像数量?
有没有办法实现这些?通过 jquery 或 CSS?
解决方案
推荐阅读
- javascript - 为什么我的动画最后会传送到左下角
- c - C程序添加2个多项式然后显示它
- javascript - 页面重定向后,如何使用纯 JavaScript 保存包含对象的数组?
- c - 在C中从结构指针到函数执行函数
- twilio - Twilio API PHP:仅检索从某个手机号码(FROM)收到的最新短信
- sql - 如何使用计数功能
- c# - 如何以 xamarin 形式打印生成的条码 ZXING
- azure - 使用 ARM 模板使用 AppService 出站 IP 更新现有 Key Vault 防火墙 ACL
- python - InvalidImageFormatError 异常 源文件似乎不是图像
- excel - 行不包含某些文本时Excel复制单元格值