打印条形码时出错 - 代码 39
我在打印条形码(代码 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:
After printing:
-In Internet Explorer:
The only difference is that, when I try printing it shows me only the codes, like image:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论