简体   繁体   English

jQuery PrintArea打印空白页

[英]jQuery PrintArea prints blank page

I want to print a form using jQuery print area, a custom stylesheet, and some javascript code. 我想使用jQuery打印区域,自定义样式表和一些javascript代码来打印表单。 The actual site's page is: 实际站点的页面是:

http://dev.radioimagendigital.com/orden-de-servicio/

And the button that calls the print area action is "Imprimir", the css file passed as parameter to the PrintArea plugin is: 调用打印区域操作的按钮是“ Imprimir”,作为参数传递给PrintArea插件的css文件是:

http://dev.radioimagendigital.com/wp-content/themes/stability/print1.css

And the actual javascript code is: 实际的javascript代码是:

jQuery("div.b1").click(function(){
    var print = "";
    jQuery("input.selPA:checked").each(function(){
        print += (print.length > 0 ? "," : "") + ".content_orden_servicio" + jQuery(this).val();
    }); 


    var template_uri = '<?php echo get_template_directory_uri(); ?>'; 
    jQuery(".content_orden_servicio").printArea({
        mode       : "iframe",
        standard   : "html5",
        retainAttr : ["id","class"],
        printDelay : 500,
        printAlert : true,
        extraCss   : 'http://dev.radioimagendigital.com/wp-content/themes/stability/print1.css'
    });
});

As soon as I try to print the form, I got a blank page. 尝试打印表格后,我得到了空白页。 Why is that? 这是为什么? and How can I solve this issue? 以及如何解决这个问题?

Any help will be really appreciated. 任何帮助将不胜感激。

Thanks a lot 非常感谢

总体而言,这是一个CSS问题,css设法以某种方式在chrome中隐藏了打印机中的所有内容,为解决此问题,我创建了一个新的iframe,其中包含要打印的内容和css规则,并从中调用了jquery打印区域。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM