CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • US Postal Barcodes in Mailing Lables
Pages: [1]

Author Topic: US Postal Barcodes in Mailing Lables  (Read 4049 times)

labrown

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
US Postal Barcodes in Mailing Lables
February 16, 2008, 02:28:42 pm
I'm working with an organization that would like to have US Postal barcodes printed on their mailing labels.  I had hoped that CiviCRM supports this, but it appears that it does not.

How hard would it be to add printing the appropriate postal code barcode on mailing labels?

--[Lance]

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: US Postal Barcodes in Mailing Lables
February 16, 2008, 08:36:36 pm

There are a couple of things you will need to do to get this to work:

1. fix CRM/Contact/Form/Task/Label.php and generate a bar code image. I suspect there are some pear libraries that will do most of this for you.

2. investigate ufpdf (which we use to display mailing labels as pdf) and figure out how you can add the barcode image to the mailing label

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

labrown

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
Re: US Postal Barcodes in Mailing Lables
February 17, 2008, 06:02:54 am
Actually, it may be easier than that.

http://www.terryburton.co.uk/barcodewriter/ is the "Barcode Writer in Pure Postscript" and is a barcode writer written entirely in Postscript.  You can print barcodes simply by including the barcode.ps in the Postscript prologue and then calling the appropriate barcode function.

We might be able to use it to generate the barcodes instead of having to generate barcode images.

--[Lance]

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: US Postal Barcodes in Mailing Lables
February 17, 2008, 12:13:33 pm

Can you please update this topic with detailed instructions once you figure out how to do so

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

labrown

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
Re: US Postal Barcodes in Mailing Lables
February 17, 2008, 12:53:00 pm
I'll see what I can do. :-)

twowheeler

  • I post occasionally
  • **
  • Posts: 115
  • Karma: 11
    • Harrisburg Christian Performing Arts Center
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7.22
  • MySQL version: 5.1
  • PHP version: 5.3
Re: US Postal Barcodes in Mailing Lables
April 09, 2008, 04:50:11 am
I can report a little progress on this subject.  I have a very pre-alpha class which uses the barcodewriter labrown mentioned.  I can reliably output a USPS OneCode barcode into an encapsulated postscript file.  From there it is easy to convert the EPS to PDF with ghostscript using ps2pdf.

At this point I need to find a way to get the barcode into the CiviCRM label.  It needs to go at the top, above the address text.  I don't know whether it is possible to do that directly with the PS code or if we have to convert it and insert an image.  I'm still studying the Label.php and ufpdf.php code. 

Code:  http://www.pennswoods21.org/OneCodeLabel.tgz
Sample EPS output:  http://www.pennswoods21.org/test.eps
Sample PDF output:  http://www.pennswoods21.org/test.pdf

This should be executed with:
Code: [Select]
php5 -f OneCodeLabel.php > test.eps
ps2pdf test.eps
or so.  By the way I left room for someone to extend this to non-US formats should anyone be so inclined.

Any suggestions?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • US Postal Barcodes in Mailing Lables

This forum was archived on 2017-11-26.