打印条形码时出错 - 代码 39

发布于 2024-12-16 16:58:01 字数 3139 浏览 2 评论 0原文

我在打印条形码(代码 39 标准)时遇到问题。这是间歇性发生的事情。

-在 Google Chrome 中:

它通常会向我显示代码,但是当我在打印视图上看到它时,它会向我显示一个奇怪的代码,而不是它应该显示的原始条形码,如下图所示。

打印前:

打印前

打印后:

打印后

- 在 Internet Explorer 中:

唯一的区别是,当我尝试打印时,它仅显示代码,如图像:

在此处输入图像描述

我使用 CSS 来自定义条形码,并且使用文本(而不是图像)来显示条形码。

有人可以帮助我吗?

ps.:

我用于条形码的CSS(我认为这是默认的):

@font-face {
    font-family: 'C39HrP24DhTtNormal';
    src: url('c39hrp24dhtt-webfont.eot');
    src: url('c39hrp24dhtt-webfont.eot?#iefix') format('embedded-opentype'),
         url('c39hrp24dhtt-webfont.woff') format('woff'),
         url('c39hrp24dhtt-webfont.ttf') format('truetype'),
         url('c39hrp24dhtt-webfont.svg#C39HrP24DhTtNormal') format('svg');
    font-weight: normal;
    font-style: normal;

}

这是HTML:

    <head>
    <title>AAAAAAAAAA</title>
    <script language="javascript" type="text/javascript" src="Controller/Configuratuion.js"></script>
    <script language="javascript" type="text/javascript" src="Library/JQuery.js"></script>
    <script language="javascript" type="text/javascript" src="Library/AjaxHelper.js"></script>
    <script language="javascript" type="text/javascript" src="Library/Scripts.js"></script>
    <script language="javascript" type="text/javascript" src="Controller/PrintCapaloteClienteController.js"></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(function() {
            PrintCapaloteClienteController.Init();
        });
    </script>
    <link type="text/css" rel="Stylesheet" href="css/BarCode3de9/stylesheet.css" />
    <link type="text/css" rel="Stylesheet" href="css/Style.css" />
    <style type="text/css">
        body#Print
        {
            padding: 10px 10px 10px 10px;
        }
        div#BarCodeContrainer
        {
            text-align: right;
        }
        div#HeaderContainer, .footer
        {
            border: solid 2px black;
        }
        div#MainContainer
        {
            text-align: center;
        }
        .leftText
        {
            text-align: left;
        }
        .rightText
        {
            text-align: right;
        }
        .centerText
        {
            text-align: center;
        }

        .header
        {
            text-align: left;
        }

        .header th
        {
            text-align: left;
            border-top: solid 1px black;
            border-bottom: solid 1px black;
        }

        .closeLeft
        {
            border-left: solid 1px black;
        }

        .closeRight
        {
            border-right: solid 1px black;
        }
    </style>
</head>
<body>
    <div id="HeaderContainer">

    </div>
    <div id="MainContainer">

    </div>
</body>
</html>

I'm having a problem while printing barcodes (Code 39 stadard). It's something that occurs intermittently.

-In Google Chrome:

It normally shows me the code, but when I see it on print view, it shows me a strange code instead of the original barcode it should show, like images below.

Before printing:

Before printing

After printing:

After printing

-In Internet Explorer:

The only difference is that, when I try printing it shows me only the codes, like image:

enter image description here

I'm using a CSS to custom the barcode, and I'm using text, not the image, to show the barcode.

Could anyone help me?

ps.:

The CSS I'm using for the barcode (I think it is a default):

@font-face {
    font-family: 'C39HrP24DhTtNormal';
    src: url('c39hrp24dhtt-webfont.eot');
    src: url('c39hrp24dhtt-webfont.eot?#iefix') format('embedded-opentype'),
         url('c39hrp24dhtt-webfont.woff') format('woff'),
         url('c39hrp24dhtt-webfont.ttf') format('truetype'),
         url('c39hrp24dhtt-webfont.svg#C39HrP24DhTtNormal') format('svg');
    font-weight: normal;
    font-style: normal;

}

And this is the HTML:

    <head>
    <title>AAAAAAAAAA</title>
    <script language="javascript" type="text/javascript" src="Controller/Configuratuion.js"></script>
    <script language="javascript" type="text/javascript" src="Library/JQuery.js"></script>
    <script language="javascript" type="text/javascript" src="Library/AjaxHelper.js"></script>
    <script language="javascript" type="text/javascript" src="Library/Scripts.js"></script>
    <script language="javascript" type="text/javascript" src="Controller/PrintCapaloteClienteController.js"></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(function() {
            PrintCapaloteClienteController.Init();
        });
    </script>
    <link type="text/css" rel="Stylesheet" href="css/BarCode3de9/stylesheet.css" />
    <link type="text/css" rel="Stylesheet" href="css/Style.css" />
    <style type="text/css">
        body#Print
        {
            padding: 10px 10px 10px 10px;
        }
        div#BarCodeContrainer
        {
            text-align: right;
        }
        div#HeaderContainer, .footer
        {
            border: solid 2px black;
        }
        div#MainContainer
        {
            text-align: center;
        }
        .leftText
        {
            text-align: left;
        }
        .rightText
        {
            text-align: right;
        }
        .centerText
        {
            text-align: center;
        }

        .header
        {
            text-align: left;
        }

        .header th
        {
            text-align: left;
            border-top: solid 1px black;
            border-bottom: solid 1px black;
        }

        .closeLeft
        {
            border-left: solid 1px black;
        }

        .closeRight
        {
            border-right: solid 1px black;
        }
    </style>
</head>
<body>
    <div id="HeaderContainer">

    </div>
    <div id="MainContainer">

    </div>
</body>
</html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文