Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

2

How to configure PDF size for product label? [Closed]

By
Michael Storck
on 7/24/13, 7:19 AM 2,230 views

The Question has been closed

by
Ray Carnes
on 08/14/2013 20:05:53

The codesnippet below is the definition of the product label in OpenERP 6.0.3. The frame_height and frame_width are used to create a frame for the product label. So one product label is 2.8 cm high and 6.4 cm wide .

I want to print this label on a label printer, which expects the whole pdf to be 2.8 cm high and 6.4 cm wide.

How do I specify the whole PDF size to be 2.8 cm high and 6.4 cm wide in this xsl file?

<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">2.8cm</xsl:variable>
<xsl:variable name="frame_width">6.4cm</xsl:variable>
<xsl:variable name="number_columns">1</xsl:variable>
<xsl:variable name="max_frames">1</xsl:variable>

<xsl:template match="/">
    <xsl:apply-templates select="lots"/>
</xsl:template>

<xsl:template match="lots">
    <document>
        <template leftMargin="0.0cm" rightMargin="0.0cm" topMargin="0.0cm" bottomMargin="0.0cm" title="Address list" author="Generated by Open ERP">
            <pageTemplate id="all">
                <pageGraphics/>
                <xsl:apply-templates select="lot-line" mode="frames"/>
            </pageTemplate>
        </template>
        <stylesheet>
            <paraStyle name="nospace" fontName="Courier" fontSize="10" alignment="CENTER"/>
            <blockTableStyle id="mytable">
                <blockAlignment value="CENTER"/>
                <blockValign value="MIDDLE"/>
                <blockFont name="Helvetica-BoldOblique" size="14" start="0,0" stop="-1,0"/>
                <blockFont name="Helvetica" size="8" 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>
1
Michael Storck
On 8/14/13, 7:57 PM

I have found the answer on my own and i want to share the solution. The page size can be set in the template tag like this:

<document>
        <template pageSize="(175.78,79.38)" leftMargin="0.0cm" rightMargin="0.0cm" topMargin="0.0cm" bottomMargin="0.0cm" title="Address list" author="Generated by Open ERP">

The pageSize is given in DTP-point, in this case:

175.78 DTP-point = 62mm and 79.38 DTP-point = 28mm

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 7/24/13, 7:19 AM
Seen: 2230 times
Last updated: 3/16/15, 8:10 AM