此内容没有您所选择的语言版本。

18.3. Bar codes


Seam can use iText to generate barcodes in a wide variety of formats. These barcodes can be embedded in a PDF document or displayed as an image on a web page. However, barcodes cannot currently display barcode text when used with HTML images.
Expand
<p:barCode>
Description
Displays a barcode image.
Attributes
  • type — A barcode type supported by iText. Valid values include: EAN13, EAN8, UPCA, UPCE, SUPP2, SUPP5, POSTNET, PLANET, CODE128, CODE128_UCC, CODE128_RAW and CODABAR.
  • code — The value to be encoded by the barcode.
  • xpos — For PDFs, the absolute x position of the barcode on the page.
  • ypos — For PDFs, the absolute y position of the barcode on the page.
  • rotDegrees — For PDFs, the rotation factor of the barcode in degrees.
  • barHeight — The height of the bars in the barcode.
  • minBarWidth — The minimum bar width.
  • barMultiplier — The bar multiplier for wide bars or the distance between bars for POSTNET and PLANET code.
  • barColor — The color the bars should be drawn in.
  • textColor — The color of any text on the barcode.
  • textSize — The size of any text on the barcode.
  • altText — The alt text for HTML image links.
Usage
<p:barCode type="code128" barHeight="80" textSize="20" 
   code="(10)45566(17)040301" codeType="code128_ucc" 
   altText="My BarCode" />
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat