# Generate Barcode in PDF?

**URL:** <https://www.ruby-forum.com/t/generate-barcode-in-pdf/114501>\
**Category:** Ruby\
**Created:** [September 13, 2007, 2:36pm UTC](https://www.ruby-forum.com/t/generate-barcode-in-pdf/114501 "2007-09-13T14:36:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![reynar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@reynar](https://www.ruby-forum.com/u/reynar)\
**Post date:** [September 13, 2007, 2:36pm UTC](https://www.ruby-forum.com/t/generate-barcode-in-pdf/114501/1 "2007-09-13T14:36:18Z")

</div>

Hi,

I am searching for a way to dynamically generate a barcode as part of  
a PDF.

I have come across a number of older threads and discussions but no  
one seemed to confirm a tested working solution.

I wondered if anyone had since tackled the problem?

---

<div class="post-metadata">

**Author:** ![reynar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@reynar](https://www.ruby-forum.com/u/reynar)\
**Post date:** [September 13, 2007, 3:23pm UTC](https://www.ruby-forum.com/t/generate-barcode-in-pdf/114501/2 "2007-09-13T15:23:21Z")

</div>

On Thu, Sep 13, 2007 at 09:35:10PM +0900, Andrew E. wrote:

> Hi,
> 
> I am searching for a way to dynamically generate a barcode as part of  
> a PDF.
> 
> I have come across a number of older threads and discussions but no  
> one seemed to confirm a tested working solution.
> 
> I wondered if anyone had since tackled the problem?

There are innumerable free implementations of barcode generation. I  
don’t  
know of a wrapper around one of the libraries, but it should be pretty  
simple to implement. Perhaps this library would be a good start:

> **[Zint Barcode Generator](https://sourceforge.net/projects/zint/)**
>
> Download Zint Barcode Generator for free. A barcode encoding library supporting over 50 symbologies. Encodes data into any of the following: Australia Post, Aztec Code & Runes, BC412, Channel, Codabar, Codablock-F, Code 11, Code 128, Code 16K,...

Write a C extension and you’re good to go. Once you have the output in  
some  
format, you should be able to turn it into a PDF one way or another  
(e.g.  
RMagick).

–Greg

---

<div class="post-metadata">

**Author:** ![reynar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@reynar](https://www.ruby-forum.com/u/reynar)\
**Post date:** [April 23, 2008, 11:29pm UTC](https://www.ruby-forum.com/t/generate-barcode-in-pdf/114501/3 "2008-04-23T23:29:48Z")

</div>

how print barcodes in pdf quickly ???  
without Rmagick , i do that with gbarcode but is slowly when I generated  
many barcodes

---

<div class="post-metadata">

**Author:** ![reynar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@reynar](https://www.ruby-forum.com/u/reynar)\
**Post date:** [April 24, 2008, 1:52am UTC](https://www.ruby-forum.com/t/generate-barcode-in-pdf/114501/4 "2008-04-24T01:52:33Z")

</div>

On Thu, Apr 24, 2008 at 7:29 AM, Foreero I. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> how print barcodes in pdf quickly ???  
> without Rmagick , i do that with gbarcode but is slowly when I generated  
> many barcodes

[barby.rubyforge.org](http://barby.rubyforge.org) ?

No idea on speed though.

Mikel
