admin管理员组文章数量:1026989
I'm trying to print a section of a web page and there are multiple css files, and several of those files contribute to the "print" media type. Some of the plugins I've seen assume that you only have one media="print" css file and that's all it needs. I have looked at PrintArea and jsprint and am not very impressed by either of them, I believe I can tweak them to get what I need, but I'm hoping there is a better library out there that I have yet to discover.
I'm trying to print a section of a web page and there are multiple css files, and several of those files contribute to the "print" media type. Some of the plugins I've seen assume that you only have one media="print" css file and that's all it needs. I have looked at PrintArea and jsprint and am not very impressed by either of them, I believe I can tweak them to get what I need, but I'm hoping there is a better library out there that I have yet to discover.
Share Improve this question asked Nov 24, 2010 at 15:29 vaskinvaskin 5133 silver badges11 bronze badges 1- in my case printjs.crabbly. – Phd. Burak Öztürk Commented Apr 24, 2018 at 20:37
2 Answers
Reset to default 5Have a look at printThis. It es loaded with several options, such as load css.
$("#mySelector").printThis({
debug: false, // show the iframe for debugging
importCSS: true, // import page CSS
importStyle: false, // import style tags
printContainer: true, // grab outer container as well as the contents of the selector
loadCSS: "path/to/my.css", // path to additional css file - use an array [] for multiple
pageTitle: "", // add title to print page
removeInline: false, // remove all inline styles from print elements
printDelay: 333, // variable print delay
header: null, // prefix to html
footer: null, // postfix to html
base: false , // preserve the BASE tag, or accept a string for the URL
formValues: true, // preserve input/form values
canvas: false, // copy canvas elements (experimental)
doctypeString: "...", // enter a different doctype for older markup
removeScripts: false, // remove script tags from print content
copyTagClasses: false // copy classes from the html & body tag
});
I was just looking at PrintArea's source, and it seems that it does take into account multiple stylesheets. It would help if you told us what exactly you don't like about the libraries.
Also, I'm not sure how much more you'll be able to acplish with a JS-only solution than the a plugin such as PrintArea already does.
I'm trying to print a section of a web page and there are multiple css files, and several of those files contribute to the "print" media type. Some of the plugins I've seen assume that you only have one media="print" css file and that's all it needs. I have looked at PrintArea and jsprint and am not very impressed by either of them, I believe I can tweak them to get what I need, but I'm hoping there is a better library out there that I have yet to discover.
I'm trying to print a section of a web page and there are multiple css files, and several of those files contribute to the "print" media type. Some of the plugins I've seen assume that you only have one media="print" css file and that's all it needs. I have looked at PrintArea and jsprint and am not very impressed by either of them, I believe I can tweak them to get what I need, but I'm hoping there is a better library out there that I have yet to discover.
Share Improve this question asked Nov 24, 2010 at 15:29 vaskinvaskin 5133 silver badges11 bronze badges 1- in my case printjs.crabbly. – Phd. Burak Öztürk Commented Apr 24, 2018 at 20:37
2 Answers
Reset to default 5Have a look at printThis. It es loaded with several options, such as load css.
$("#mySelector").printThis({
debug: false, // show the iframe for debugging
importCSS: true, // import page CSS
importStyle: false, // import style tags
printContainer: true, // grab outer container as well as the contents of the selector
loadCSS: "path/to/my.css", // path to additional css file - use an array [] for multiple
pageTitle: "", // add title to print page
removeInline: false, // remove all inline styles from print elements
printDelay: 333, // variable print delay
header: null, // prefix to html
footer: null, // postfix to html
base: false , // preserve the BASE tag, or accept a string for the URL
formValues: true, // preserve input/form values
canvas: false, // copy canvas elements (experimental)
doctypeString: "...", // enter a different doctype for older markup
removeScripts: false, // remove script tags from print content
copyTagClasses: false // copy classes from the html & body tag
});
I was just looking at PrintArea's source, and it seems that it does take into account multiple stylesheets. It would help if you told us what exactly you don't like about the libraries.
Also, I'm not sure how much more you'll be able to acplish with a JS-only solution than the a plugin such as PrintArea already does.
本文标签:
版权声明:本文标题:What is the best browser printing library, plugin, or snippet for javascriptjquery? - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745224600a2140570.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论