Printing Barcodes from Ruby

L

listrecv

I'd like to be able to generate barcodes from Ruby (to a PDF document).
What is the best way to do this?

Does it suffice to just get some barcode fonts, and use those, or do I
need special libs? Any help appreciated.
 
C

Csaba Henk

- install GNU barcode from
http://www.gnu.org/software/barcode/barcode.html
- use Latex to import postscript files generated by GNU barcode
- use ruby to glue those tools

You might as well try to use GrailTeX (

http://tipogral.hu/index.rbx/site/projects/grailtex

), a new, compact, web-centric TeX distribution with support for
package management (for the TeX/CTAN packages included). It comes with
everything you need for barcode generation, as the online demo on the
referred page shows.

Regards,
Csaba
 
B

Bojan Mihelac

I'd like to be able to generate barcodes from Ruby (to a PDF document).
What is the best way to do this?

Does it suffice to just get some barcode fonts, and use those, or do I
need special libs? Any help appreciated.
I think you can embed some font (I am not sure what is name of font) to
PDF and write directly in it.

best regards,
Bojan
 
L

listrecv

Bojan said:
I think you can embed some font (I am not sure what is name of font) to
PDF and write directly in it.

That would certainly be the easiest - easier than converting from
PostScript. I could do the whole thing as a PDF form.

Does anyone know more about this?

Also, does anyone know if there are any libs with Ruby bindings which
can apply a FDF/XFDF to a PDF? (I don't think Pdf::Writer can - am I
correct?)
 
B

Bojan Mihelac

That would certainly be the easiest - easier than converting from
PostScript. I could do the whole thing as a PDF form.

Does anyone know more about this?

Also, does anyone know if there are any libs with Ruby bindings which
can apply a FDF/XFDF to a PDF? (I don't think Pdf::Writer can - am I
correct?)
I see there are plenty of barcode Code 39 true type fonts available and
some are free as well a litle googling would do.

I had some troubles embeding fonts with Pdf::Writer so please write if
you get it working with Pdf::Writer.
 
L

listrecv

Rob said:
Right now we're using the method described here ->
http://wiki.rubyonrails.org/rails/pages/HowtoGeneratePDFs under the
heading PDF Form Fill. It calls pdftk externally, it is not a ruby
binding or anything. Don't be put off by this being a Rails link, the
technique works just fine without Rails installed.


Rob,

I took a look at that. Looks good, except that FDF generator looks
very hackish. Is there a cleaner way of doing this, perhaps using
XFDF?

(Also, how did you generate the PDF initially - just using a word
processor, and adding form fields in Acrobat?)
 
R

Rob Kaufman

I agree with you that the create_fdf method is kind of a "magic" hack,
but it allows you to very simply take hash data to fill in a form.
I'll be honest, though I understand how it works, I didn't create this
method or do much to change it. Using pdftk makes a lot of since to
me, since leveraging a separate tool increases the debugging base.

We're using Acrobat to create our form template.

Rob Kaufman
 
A

Austin Ziegler

I'd like to be able to generate barcodes from Ruby (to a PDF document).
What is the best way to do this?

Does it suffice to just get some barcode fonts, and use those, or do I
need special libs? Any help appreciated.

I hope to be able to add this to PDF::Writer in the future. Don't hold
your breath for it; I'm on vacation and *way* behind on PDF::Writer
development, but note that it is planned for the future inasmuch as I
can make it happen.

-austin
 
L

listrecv

Austin said:
I hope to be able to add this to PDF::Writer in the future. Don't hold
your breath for it; I'm on vacation and *way* behind on PDF::Writer
development, but note that it is planned for the future inasmuch as I
can make it happen.

Great, I really appreciate that.
 
P

Paolo Guzziii

Hi to All,
i'm italian and I must generate a barcode into a PDF file.

I'm using
O.S: Windows XP Professional
Ruby: 1.8.5
Rails: 1.2.1

... I found a ruby gem (barcode-0.2.gem) to do this, at least I think
:)).
Is it the right way to do it?
Where can I find some documentation?

Paolo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top