For anything that has to do with printing I always use LaTeX - since 34 years ago when I first entered the Sun computer lab at my alma mater and saw many happy hippies rendering LaTeX into postscript in reverse polish notation. I have never looked at anything else. Paraphrasing Fellini, "It's easier to be faithful to LaTeX than it is to a ...".

So, I would follow the advice of fellow monks and prepare the labels using LaTeX. My experience is that LaTeX is quite good at packing content in a single page in order to save paper. But it also supports various paper sizes. I am pretty sure there are many packages supporting creating labels. I know there is a package for beer bottle labels.

The crucial step in automating this process fully is by using templates. That is, templated LaTeX documents. The added bonus here is that, in this way, you keep View, Model and Controller separated.

I guess Libre/Open-Office also support some form of templates which one can, additionally, programmatically render into printer-ready documents. So, you can go this way, especially if there is a CPAN module for this.

Shamelessly, I will plug a module I have published LaTeX::Easy::Templates. It makes it fairly easy to supply a Perl Data Structure containing your data (e.g. an array of addresses) plus a LaTeX template file (in-memory or on-disk) and produce a PDF document.

Edit: I have posted a tutorial on how to print the labels using LaTeX::Easy::Templates here: Using LaTeX templates to typeset, use-case: printing labels

bw, bliako


In reply to Re: Printing Labels by bliako
in thread Printing Labels by Bod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.