- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图从运行的 PrimeFaces Showcase 中获取条形码,但是当我放置 XHTML 代码并让它在我本地的 Wildfly 8 中运行时,我得到的完全是垃圾。每个条形码的数字太大,二维码根本不起作用。
我相信我可能缺少 Maven 依赖项,但我很难找到必要的依赖项。
按照文档,我想我必须在 2.1
版本中集成对 barcode4j-light
的依赖,但我在 Maven 上找不到这个版本。
我将如何整合它?我将不胜感激!提前致谢!
我的 Barcode.xhtml:
<!DOCTYPE html>
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head/>
<h:body>
<p:panelGrid columns="2">
<h:outputText value="Interleaved 2 of 5" />
<p:barcode value="0123456789" type="int2of5" />
<h:outputText value="Codabar" />
<p:barcode value="0123456789" type="codabar"/>
<h:outputText value="Code39" />
<p:barcode value="0123456789" type="code39" />
<h:outputText value="Code128" />
<p:barcode value="0123456789" type="code128"/>
<h:outputText value="EAN-8" />
<p:barcode value="20123451" type="ean8"/>
<h:outputText value="EAN-13" />
<p:barcode value="0123456789012" type="ean13"/>
<h:outputText value="UPC-A (PNG)" />
<p:barcode value="01234567895" type="upca" format="png"/>
<h:outputText value="UPC-E (Vertical)" />
<p:barcode value="01234133" type="upce" orientation="90"/>
<h:outputText value="PDF417" />
<p:barcode value="0123456789" type="pdf417"/>
<h:outputText value="DataMatrix" />
<p:barcode value="0123456789" type="datamatrix"/>
<h:outputText value="Postnet" />
<p:barcode value="0123456789" type="postnet"/>
<h:outputText value="QR" />
<p:barcode value="0123456789" type="qr"/>
</p:panelGrid>
</h:body>
</html>
我的 pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.glasses</groupId>
<artifactId>primeWork</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<name>primeWork</name>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>7.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
最佳答案
因此 barcode4j-light-2.1
在 Maven 存储库中不可用。我们需要从SourceForge下载它.下载并解压缩后,转到 build
目录。 barcode4j-light
jar 将在那里。
要将其安装到本地 Maven 存储库,请遵循 these instructions .基本上,从命令行(从 build
目录并假设您安装了 Maven):
C:\...build>mvn install:install-file -Dfile=barcode4j-light.jar
-DgroupId=net.sf.barcode4j
-DartifactId=barcode4j-light
-Dversion=2.1
-Dpackaging=jar
该命令应全部在一行中,而不是像您在此处看到的那样以行分隔。然后你可以将依赖添加到你的项目中
<dependency>
<groupId>net.sf.barcode4j</groupId>
<artifactId>barcode4j-light</artifactId>
<version>2.1</version>
</dependency>
你还需要这个
<dependency>
<groupId>net.glxn</groupId>
<artifactId>qrgen</artifactId> <!-- QR code support -->
<version>1.4</version>
</dependency>
不是像这样一步一步来的,而是在 Prime Faces User Guide 中描述的.一旦我按照上述步骤操作,它对我有用。
关于maven - PrimeFaces 条码不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26686351/
也许有一个简单的解决方案,但我似乎找不到,我需要在不增加字体大小的情况下增加条形码的高度。 // Barcode Text Block
当我使用code128.createImageWithBarcode()创建图像时,条形码下的文本出现在文档中,但是当我尝试使用createAwtImage创建图像并稍后将其保存到光盘时,条形码下的文
我一直在尝试获取 this库在我的 android 应用程序中工作,但我无法让它成功工作。我有 fragment 显示,相机显示正常,但它似乎没有扫描任何东西(QR、条形码等)。我已经实现了回调接口(
我正在使用 zebraGk420d 打印机。我正在使用垂直条形码标签。如何垂直打印文本和条形码。我的 zpl 代码是这样的 $barcode_ZPL_code="^XA ^FO 150,50^AD,4
我正在尝试创建一个简单的 EAN13 图像来显示字符串中的条形码。 我试过这段代码,但它只能生成一个code128。我可以使用什么来生成 EAN13? class Barcode { class
我尝试使用Zxing解码128C(代码集C)条形码。当我读取 QR_CODE、UPC_A 等其他类型时,我会成功。 这些是我尝试读取的条形码: 是否可以使用 Zxing 读取 128C 条码(非 CO
[已解决]这些应用程序运行良好,没有崩溃,但它应该将 resultView 文本从“Hasil Scan”更新为扫描结果,但事实并非如此。问题是 TextView (结果 View )在扫描后没有更新
我有一个项目,它绘制了一个价格标签,上面有一个条形码。要绘制条形码,我使用设置了 EAN-13 字体的 JLabel。生成价格标签的输入数据由两个条形码属性组成:条形码编号 080432402184
我正在我的应用程序中实现条形码扫描器。我想限制我的检测区域。遵循以下逻辑,但我在某些设备上无法正常工作。 //尝试裁剪框架的中心部分: public class BoxDetector extend
我正在尝试使用 ZXing 库来解码 Datamatrix 条码。这是我的代码示例: BufferedImage bi = img.getBufferedImage(); Hashtable hint
Data Matrix 条形码支持已添加到 iOS 8 中,我可以使用它来读取 Data Matrix 条形码,如果它们是白底黑字(暗色)。但是,它从不读取黑底白字(深色底色)条码。 读这个很好: 无
我有这段代码可以生成条形码: func generateBarcode(from string: String) -> UIImage? { let data = string.data(us
这个问题在这里已经有了答案: What is the actual HEX / binary value of the GS1 FNC1 character? (2 个答案) 关闭 4 年前。 如何
我需要用 code128 barcodes 生成标签在 PHP . 用户几乎可以使用任何打印机打印这些内容。 我有一些具体的要求: 窄条宽度应介于 0.375 毫米和 0.5 毫米之间 最大整体条码宽
我想从我的应用程序创建 Code39 编码的条形码。 我知道我可以为此使用字体,但我不想这样做,因为我必须在服务器上注册字体,而且我有一些非常糟糕的经历。 我在问这个问题后产生的一个例子是答案 最佳答
将零抑制的八位 GTIN-12 标识符(表示为 UPC-E 条形码)转换为 UPC-A 条形码中显示的完整十二位版本的算法是什么? 最佳答案 从以下模式映射可以最清楚地看出在 UPC-E 和 UPC-
HTML文件 进程.php $value = $_post['barcode_value']; 嗨, friend 们,我要为 Android 设备开发一个 Web 应用程序,如果我点击输入文本框
我有一个相当大的 XML 数据集,例如: … … … … … … Mon, 24 Aug 2015, 8:30am
我正在测试来自 android-vision 的条码 API repo (多跟踪器应用程序)。但我只能扫描二维码,我还想扫描一维条形码,如 EAN 13。我怎样才能做好这项工作?? Ps.: 另外,我
我想从 C# 程序创建 DataMatrix ECC200 条码。是否有关于如何将信息编码到条形码中的文档,或者是否有第 3 方程序集来实现此目的? 最佳答案 你看过iec16022sharp了吗?
我是一名优秀的程序员,十分优秀!