首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Barcode4j不工作(在Unix上)

Barcode4j不工作(在Unix上)
EN

Stack Overflow用户
提问于 2011-10-18 16:35:57
回答 1查看 1.3K关注 0票数 0

对于我的项目,我需要生成一个PDF条形码。

我已经成功地在本地Windows上生成了条形码,在生产UNIX服务器上,生成失败了。

我使用barcode4j并需要生成code39。

我的模板:

代码语言:javascript
复制
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:fo="http://www.w3.org/1999/XSL/Format" 
    xmlns:bc="http://barcode4j.krysalis.org/ns" 
    xmlns:barcode="org.krysalis.barcode4j.xalan.BarcodeExt" 
    extension-element-prefixes="barcode"
    exclude-result-prefixes="fo">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="no" indent="yes"/>
    <xsl:param name="versionParam" select="'1.0'"/> 

    <xsl:template match="anforderung">
        <xsl:call-template name="barcode">
        <xsl:with-param name="code" select="barcode/code" />
        <xsl:with-param name="codeoriginal" select="barcode/codeoriginal" />
        </xsl:call-template>
    </xsl:template>

    <xsl:template name="barcode">
        <xsl:param name="code" />
        <xsl:param name="codeoriginal" />
        <fo:block keep-together="always">
            <!-- message für barcode -->
            <xsl:variable name="barcode-cfg">
            <barcode>
                <code39>
                    <height>16mm</height>
                    <module-width>0.3mm</module-width>
                    <human-readable>
                        <placement>none</placement>
                    </human-readable>
                </code39>
            </barcode>
            </xsl:variable>

            <fo:block font-weight="bold" margin-left="0.3in">
                <fo:table table-layout='fixed' width="100%">
                    <fo:table-column column-width="8.2cm" />
                    <fo:table-column column-width="12cm" />
                    <fo:table-body>
                        <fo:table-row>
                            <fo:table-cell>
                                <fo:block>
                                    <fo:instream-foreign-object>
                                        <xsl:variable name="bc" select="barcode:generate($barcode-cfg, barcode/code)" />
                                        <xsl:copy-of select="$bc" />
                                        <!--xsl:copy-of select="barcode:generate(barcode-cfg, msg)"/-->
                                    </fo:instream-foreign-object>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell>
                                <fo:block text-align="justify" font-size="32pt">
                                    <xsl:value-of select="$codeoriginal" />
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                    </fo:table-body>
                </fo:table>
            </fo:block>
        </fo:block>
    </xsl:template>

我的图书馆:

  • barcode4j-fop-ext-complete-2.0
  • xalan
  • xercesImpl
  • xml-apis
  • xml-apis-ext
EN

回答 1

Stack Overflow用户

发布于 2011-10-22 20:26:40

NoSuchMethodError在Avalon类DefaultConfiguration中意味着您可能在类路径中有一个旧的Avalon。请确保您有AvalonFramework4.2.0或更高版本。您可以在Barcode4J的lib目录中找到它。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7810681

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档