Jspdf不打印精确的HTML视图 [英] Jspdf doesnot print exact HTML view

查看:369
本文介绍了Jspdf不打印精确的HTML视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设计好了,基本上调整了三个不同的表,它们似乎是一个单独的表。所有这三个表都是不同的。列。



实际上,我试图打印整个html(表格)部分,它完全出现在使用内部css和jQuery完成设计的网页上。





我正在使用printThis.js打印....代码如下:



我尝试了什么:



I have designed, basically adjusted three different tables along in such a away that it seems to be a single table. All the three tables are different nos. of column.

Actually, I'm try to print the entire html(table) section exactly it appears on webpage where the design has been done using internal css and jQuery.


I'm using printThis.js to print....the code is as:

What I have tried:

$(document).on("click", "#btnPrintInvoice", function (e) {
            e.preventDefault();
            e.stopPropagation();
            $("#printableContent").printThis({
                debug: false,               
                importCSS: true,            
                importStyle: true,           
                printContainer: true,      
                loadCSS: "", 
                pageTitle: "Test002",
                removeInline: false,        
                printDelay: 333,            
                header: null,               
                formValues: true            
            });

        });

推荐答案

document )。on( 点击 #btnPrintInvoice function (e){
e.preventDefault();
e.stopPropagation();
(document).on("click", "#btnPrintInvoice", function (e) { e.preventDefault(); e.stopPropagation();


#printableContent)。printThis({
debug: false
importCSS: true
importStyle: true
printContainer: true
loadCSS:
pageTitle: Test002
removeInline: false
printDelay: 333
header: null
formValues: true
});

});
("#printableContent").printThis({ debug: false, importCSS: true, importStyle: true, printContainer: true, loadCSS: "", pageTitle: "Test002", removeInline: false, printDelay: 333, header: null, formValues: true }); });


之前我曾使用JSPDF并遇到过类似的问题; PDF呈现无法使用多个标准HTML样式元素。这是一个很酷的产品,但确实有一些严重的限制。



我运气最好用自动表 [ ^ ]并创建在创建可打印表时严格使用的样式。这将需要一些研究和实验才能使样式正确。
I've worked with JSPDF before and encountered similar problems; the PDF rendering is not capable of using several of the standard HTML styling elements. It's a cool product, but it does have some serious limitations.

I had the most luck using Auto-Table[^] and creating a style strictly used when creating a printable table. It's going to take a bit of research and experimentation to get the styling right.


这篇关于Jspdf不打印精确的HTML视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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