【问题标题】:Unable to render all barcode images on print preview无法在打印预览中呈现所有条码图像
【发布时间】:2014-03-14 04:39:01
【问题描述】:

我正在使用 Jqprint 插件来打印 porpose

条码打印代码

HTML代码为:

<div class="wrapper_template" id="print_template">
   <div class="imageOutput" >
 // Code for Printing barcode for different Products  
   </div>
</div>

Javascript 代码为:

<script language="javascript" type="text/javascript">
$(document).ready(function() {
                $(".print_link").click( function() {
                    $('#print_template').jqprint({ operaSupport: true });
                    return false;
                });
             });
</script>

但主要问题是无法在打印预览中呈现所有条形码图像。 任何人都可以解决这个问题。 请帮帮我。

【问题讨论】:

  • 条形码是呈现为图像还是基于自定义字体的条形码?
  • 其基于字体的条形码,如果我尝试一次打印 50 个条形码,则渲染时将丢失 4-5 个条形码
  • 如果无法查看代码和字体,将很难诊断问题。一个问题可能是您的布局中有未清除的浮动,因此您可以尝试将条形码元素样式设置为 display:block;明确:两者; jqprint 插件还提供了一个参数 importCSS,您可以尝试将其与operaSupport 一起设置为true。如果这些都无济于事,您应该尝试在不使用特殊字体的情况下进行打印,以查看文本是否打印 - 如果没有,您将知道这更多的是布局或 CSS 问题,而不是字体渲染问题。
  • 所有文本呈现,但很少有条码不呈现我认为这不是 css 的问题,因为只有少数条码不能呈现并非所有条码 :)
  • 如果您在没有 jqprint 的情况下打印 - 只是本机浏览器打印怎么办?那么条形码都显示了吗?

标签: javascript jquery printing barcode jqprint


【解决方案1】:

我通过更改核心文件解决了上述问题

opt.printContainer = true;

到

opt.printContainer = false;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-20
    • 2015-12-06
    • 2012-09-25
    • 1970-01-01
    • 1970-01-01
    • 2011-05-13
    • 1970-01-01
    相关资源
    最近更新 更多