Zebra 2824 Plus label printing 1.25 x 2.25 with Odoo
If you’re trying to print on 1.25″ x 2.25″ Zebra labels here a drop in product label replacement.
Important info: Apache FOP tag <target-resolution> must be at 203 on the Zebra 2824 Plus to print a scannable Barcode128.
Go to /opt/openerp/odoo/addons/product/report/ and then replace product_label.xsl with the following:
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:variable name="initial_bottom_pos">0</xsl:variable> <xsl:variable name="initial_left_pos">0</xsl:variable> <xsl:variable name="height_increment">0</xsl:variable> <xsl:variable name="width_increment">0</xsl:variable> <xsl:variable name="frame_height">3cm</xsl:variable> <xsl:variable name="frame_width">5.5cm</xsl:variable> <xsl:variable name="number_columns">1</xsl:variable> <xsl:variable name="max_frames">8</xsl:variable> <xsl:template match="/"> <xsl:apply-templates select="lots"/> </xsl:template> <xsl:template match="lots"> <document> <target-resolution>203</target-resolution> <template pageSize="(5.6cm,3cm)" leftMargin="0.0cm" rightMargin="0.0cm" topMargin="0.0cm" bottomMargin="0.0cm" title="Address list" author="Generated by OfficePros"> <pageTemplate id="all"> <pageGraphics/> <xsl:apply-templates select="lot-line" mode="frames"/> </pageTemplate> </template> <stylesheet> <paraStyle name="barcode" fontName="code128" fontSize="12" spaceBefore="0" spaceAfter="0"/> <paraStyle name="bigger" fontName="Helvetica-Bold" fontSize="9" spaceBefore="0" spaceAfter="0"/> <paraStyle name="nospace" fontName="Helvetica" fontSize="6" spaceBefore="0" spaceAfter="0"/> <blockTableStyle id="mytable"> <blockBackground colorName="white" start="0,0" stop="0,0"/> <blockBackground colorName="white" start="1,0" stop="-1,0"/> <blockAlignment value="CENTER"/> <blockValign value="MIDDLE"/> <blockFont name="Helvetica-BoldOblique" size="10" start="0,0" stop="-1,0"/> <blockFont name="Helvetica" size="6" start="0,1" stop="-1,1"/> <lineStyle kind="GRID" colorName="black" tickness="1"/> </blockTableStyle> </stylesheet> <story> <xsl:apply-templates select="lot-line" mode="story"/> </story> </document> </xsl:template> <xsl:template match="lot-line" mode="frames"> <xsl:if test="position() < $max_frames + 1"> <frame> <xsl:attribute name="width"> <xsl:value-of select="$frame_width"/> </xsl:attribute> <xsl:attribute name="height"> <xsl:value-of select="$frame_height"/> </xsl:attribute> <xsl:attribute name="x1"> <xsl:value-of select="$initial_left_pos + ((position()-1) mod $number_columns) * $width_increment"/> <xsl:text>cm</xsl:text> </xsl:attribute> <xsl:attribute name="y1"> <xsl:value-of select="$initial_bottom_pos - floor((position()-1) div $number_columns) * $height_increment"/> <xsl:text>cm</xsl:text> </xsl:attribute> </frame> </xsl:if> </xsl:template> <xsl:param name="pmaxChars" as="xs:integer" select="30"/> <xsl:template match="lot-line" mode="story"> <blockTable style="mytable" colWidths="3.5cm,2cm"> <tr> <td> <para style="bigger"><xsl:value-of select="code"/></para> </td> <td> <para style="bigger" t="1"><xsl:value-of select="price"/><xsl:text> </xsl:text> <xsl:value-of select="currency"/></para> </td> </tr> <tr> <td> <barCode code="code128" barWidth="0.8" alignment="CENTER"><xsl:value-of select="code"/></barCode> </td> <td> <para style="nospace"><xsl:value-of select="substring(product, 1, $pmaxChars)"/></para> <para style="nospace"><xsl:value-of select="variant"/></para> </td> </tr> </blockTable> </xsl:template> </xsl:stylesheet>