xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Kattestaart <jkattesta...@gmail.com>
Subject best way to get a rotated barcode with fop 0.95
Date Fri, 13 Mar 2009 07:36:11 GMT
Hi all,

A customer of us requested a rotated barcode. I searched the archives and if
found something about SVG reference orientation.
This seems to work but i noticed two things.
1. the barcode lines seems to be thicker
2. the human readable format is missing

I tested with fop0.95 and barcode4j2.0. I used the following code to
generate the barcode.

xsl:

      <fo:instream-foreign-object>
        <xsl:variable name="bc" select="barcode:generate(., msg)"/>
        <svg:svg xmlns:svg="http://www.w3.org/2000/svg">
          <xsl:attribute name="width"><xsl:value-of
select="$bc/svg:svg/@width"/></xsl:attribute>
          <xsl:attribute name="height"><xsl:value-of
select="$bc/svg:svg/@height"/></xsl:attribute>
          <svg:rect x="0mm" y="0mm" fill="white">
            <xsl:attribute name="width"><xsl:value-of
select="$bc/svg:svg/@width"/></xsl:attribute>
            <xsl:attribute
name="height"><xsl:value-of select="$bc/svg:svg/@height"/></xsl:attribute>
          </svg:rect>
             <svg:g transform="translate(100, 0), rotate(90)">
          <xsl:copy-of select="$bc"/>
        </svg:g>
        </svg:svg>
      </fo:instream-foreign-object>
xml:

 <barcode>
    <msg>P20968-002</msg>
    <code128>
      <width>2.5cm</width>
      <height>10cm</height>
      <module-width>0.53mm</module-width>
    </code128>
  </barcode>

-- 
John Kattestaart
jkattestaart@gmail.com

Mime
View raw message