You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by John Kattestaart <jk...@gmail.com> on 2009/03/13 08:36:11 UTC
best way to get a rotated barcode with fop 0.95
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
Re: best way to get a rotated barcode with fop 0.95
Posted by John Kattestaart <jk...@gmail.com>.
Jeremias,
OK thanks for the update
2009/3/13 Jeremias Maerki <de...@jeremias-maerki.ch>
> Rotating the SVG should work correctly (which output format do you
> generate?) but probably a better way is to switch from the XSLT
> extension to the FOP extension where you can directly specify the
> orientation of the barcode:
>
> http://barcode4j.sourceforge.net/2.0/fop-ext.html#Using+the+barcode+extension+for+Apache+FOP
>
> On 13.03.2009 08:36:11 John Kattestaart wrote:
> > 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
>
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
--
John Kattestaart
jkattestaart@gmail.com
Re: best way to get a rotated barcode with fop 0.95
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Rotating the SVG should work correctly (which output format do you
generate?) but probably a better way is to switch from the XSLT
extension to the FOP extension where you can directly specify the
orientation of the barcode:
http://barcode4j.sourceforge.net/2.0/fop-ext.html#Using+the+barcode+extension+for+Apache+FOP
On 13.03.2009 08:36:11 John Kattestaart wrote:
> 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
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org