Odoo Help


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.


Why is there an empty/blank page at the end of the PDF when printing product labels?

on 2/7/14, 8:30 AM 4,048 views

When I print a product label (or several at the same time) there's always a blank page at the end of the resulting PDF document. I've searched a long time for a solution, but nobody else seems to complain about this behavior, I'm surprised as this seems to be the default behavior with a clean OpenERP installation, so it's not the result of any of my modifications. This is a pain in the a$$, as each time I print a label I waist an empty label in the printer...or I have to manually tell Acrobat to ignore the last page.

After investigating on my own, I've figured out that the <nextFrame /> tag is what causes this issue. So as a temporary fix, I've removed it from the "product_label.xsl" code, this solution works fine when printing one label, but when I try to print several at once, the label frames overlap each other...

So, is there anyone else having this problem? and if so, have you come up with a solution?

Here is the actual code I'm using for the label layout in the "product_label.xsl":

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl=w w w . o r g/1999/XSL/Transform" xmlns:fo="http : / / w w w .w 3. org/1999/XSL/Format">
 <xsl:template match="label">
 <document filename="Product Label.pdf">
 <template pageSize="(80mm, 50mm)" 
           leftMargin="1.4mm" rightMargin="1.4mm" topMargin="0mm" bottomMargin="0mm" 
           title="Product Label" author="Turbo Internacional">
 <pageTemplate id="all">
     <frame id="first" x1="0" y1="0" width="80mm" height="50mm"/>
 <paraStyle name="st_product" fontName="Helvetica" leading="10" fontSize="7"  spaceBefore="0"   spaceAfter="0"/>
 <paraStyle name="st_description"  fontName="Helvetica" leading="10" fontSize="7"  spaceBefore="0"   spaceAfter="0" alignment="left"/>

<blockTableStyle id="st_table">
                         <blockAlignment value="CENTER"/>
                         <blockValign value="TOP"/>
 <xsl:apply-templates select="product_label" mode="story"/>

 <xsl:template match="product_label" mode="story">
    <blockTable style="st_table">
                <para style="st_product"><xsl:text>Ref: </xsl:text><xsl:value-of select="product"/></para>
                <para style="st_description"><xsl:value-of select="description"/><xsl:text>  </xsl:text></para>

                <barCode code="ean13" height="17mm" width="40mm" alignment="CENTER"><xsl:value-of select="ean13" /></barCode>
On 1/30/15, 5:29 AM

Guys have you tried to print product labels with multiple product variant attribute types? like size, color? For me it only prints one for example size attribute and ignores the other


Med Said BARA

--Med Said BARA--
| 5 5 7
--Med Said BARA--
Med Said BARA
On 2/8/14, 1:08 PM


Try also to remove the closing tag <nextframe/>, and see if it works.

Nop, it doesn't work, I receive this error when trying to print "SyntaxError: JSON.parse: unexpected end of data"

on 2/8/14, 3:21 PM

Are you using Oerp V7, Are you printing on a label printer (which one ZEBRA SATO ....) ?

Med Said BARA
on 2/8/14, 3:43 PM

Yes, I'm using OpenERP v7 on an Ubuntu 13.04 server, and I'm using a Toshiba B-SV4T Thermal label printer, but the printer doesn't matter right now, because for the moment I'm not printing directly to the printer (because there's no drivers available for that printer in Ubuntu), when I click the Print Label button, openerp saves a PDF document, and there's where I get the extra blank page, at the end of that PDF. Once this PDF is created, I send it to the label printer (which is installed in one of the Windows client dektops we have in our company)

on 2/8/14, 4:22 PM

Try using those modules from AGAPLAN: label_print and label_print_stock

Med Said BARA
on 2/8/14, 4:23 PM

I've already tried both those modules, they seem interesting, but they're not what I'm looking for exactly. I'm happy with my current setup...as long as I figure out how to delete that extra blank page in the PDF labels. But really, am I the only one having that issue with product labels?? Since I first saw that issue, I've reinstalled Ubuntu, reinstalled OpenERP, updated it, created a new database and company....but I always get that extra blank page at the end of the product label PDF documents...So I've discarded this issue being a problem related to my current installation.

on 2/8/14, 4:36 PM

You must install the Driver for B-SV4T, use this one from GITHUB : CUPS Raster Drvier for the Toshiba TEC TPCL based label printers, configure you label size, revert all changes you made in the .xsl file except the template page size and margins, after that you can print directly to the printer and if needed (if you are using FireFox) you can use extension for fireFox like AttendPrint or qz-print-free_1.8.0_src.7z from qzindustries to print directly to the printer

Med Said BARA
on 2/8/14, 4:37 PM

WOW, that's a helpful answer!..I wasn't aware of those drivers..I actually started searching for them last Friday, with no luck. I'll try it on Monday when I'm back at the office and let you know, hopefully you've helped me kill 2 birds with one stone. thanks!

on 2/8/14, 4:43 PM

At first Don't forget to calibrate your printer with the roll of label you are using to avoid the overlapping, this calibration permit to the printer to recognise the begining and the ending of the laben (Height). After that the driver will handle all the printing operation correctly and will free you from dealing with pdf paper size and so on ...

Med Said BARA
on 2/8/14, 4:46 PM

One Bird for you and the second for me. GOOD LUCK

Med Said BARA
on 2/8/14, 4:48 PM

Yes, I've done that already when testing the printer on the Windows desktop.

on 2/8/14, 4:50 PM

I tried installing the drivers you suggested at " github.com/samlown/rastertotpcl " , but no luck, I get the same error as this guy while installing: " github.com/samlown/rastertotpcl/issues/1 " , I suppose the drivers are outdated and not compatible with the latest Ubuntu version.

on 2/11/14, 5:23 AM

What about CUPS: install CUPS before installing the driver (sudo apt-get install libcupsimage2-dev) or from source (make and after sudo make install)

Med Said BARA
on 2/11/14, 9:47 AM

Yes, I've done both...and I get the same errors as this guy: link " github.com/samlown/rastertotpcl/issues/1 "

on 2/11/14, 12:31 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

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

Question tools

2 follower(s)


Asked: 2/7/14, 8:30 AM
Seen: 4048 times
Last updated: 3/16/15, 8:10 AM