http://gbarcode.rubyforge.org/rdoc/index.html
On Nov 5, 4:28 pm, "Jeff Rafter" <jeffraf...@gmail.com> wrote:
> Hi Baobab volunteers!
>
> I am hoping one of you (or more) are old Perl junkies and can help us out.
> In the past couple weeks we came up with a plan that will help in rolling
> out the system at a couple of locations. First some background: In Malawi
> (like many other countries) we are coming from a paper based system.
> Practically this means each patient has a "Mastercard" which is a big card
> that explains who thet are, why/when they started HIV treatments, and some
> details about each visit (each page of the mastercard represents one year).
> There is a PDF in the files as an example.
>
> http://groups.google.com/group/baobab-volunteers/web/mastercard.pdf
>
> Last week we used Ruby FPDF to build the mastercard printout. We also hacked
> in a couple of helpers for testing (which should be expanded). We have come
> up with a plan that requires someone to scan in the barcode on the form,
> pass it through a printer and the system will print out the most recent
> visit. We are looking to pilot this soon. However we need some barcode
> loving on the form. I built a quick barcode extension using the info from
> the FPDF website (prints UPC-A and EAN13). But what we really would like to
> have is a CODE128 barcode. I found a public version of this on CPAN (in
> Perl) here:
>
> http://search.cpan.org/~wrw/Barcode-Code128-2.01/lib/Barcode/Code128.pm
>
> Ideally we would translate this to Ruby and shove it into an extension. I
> was wondering if anyone wanted to take on the task. I uploaded the files I
> completed to the group while we continue to sort out git repo access
>
>
> There is a very limited test here... obviously I was hacking away when I
> should have been BDDing:
>
> http://groups.google.com/group/baobab-volunteers/web/mastercard_pdf_t...
I am a bit of a perl-hacker but I have this huge dealine coming up. If
this can wait (for a month or so) I'd love to attack it.
:-)
Nina
On Nov 5, 5:28 pm, "Jeff Rafter" <jeffraf...@gmail.com> wrote:
> Hi Baobab volunteers!
>
> I am hoping one of you (or more) are old Perl junkies and can help us out.
> In the past couple weeks we came up with a plan that will help in rolling
> out the system at a couple of locations. First some background: In Malawi
> (like many other countries) we are coming from a paper based system.
> Practically this means each patient has a "Mastercard" which is a big card
> that explains who thet are, why/when they started HIV treatments, and some
> details about each visit (each page of the mastercard represents one year).
> There is a PDF in the files as an example.
>
> http://groups.google.com/group/baobab-volunteers/web/mastercard.pdf
>
> Last week we used Ruby FPDF to build the mastercard printout. We also hacked
> in a couple of helpers for testing (which should be expanded). We have come
> up with a plan that requires someone to scan in the barcode on the form,
> pass it through a printer and the system will print out the most recent
> visit. We are looking to pilot this soon. However we need some barcode
> loving on the form. I built a quick barcode extension using the info from
> the FPDF website (prints UPC-A and EAN13). But what we really would like to
> have is a CODE128 barcode. I found a public version of this on CPAN (in
> Perl) here:
>
> http://search.cpan.org/~wrw/Barcode-Code128-2.01/lib/Barcode/Code128.pm
>
> Ideally we would translate this to Ruby and shove it into an extension. I
> was wondering if anyone wanted to take on the task. I uploaded the files I
> completed to the group while we continue to sort out git repo access
>
>
> There is a very limited test here... obviously I was hacking away when I
> should have been BDDing:
>
> http://groups.google.com/group/baobab-volunteers/web/mastercard_pdf_t...
So here is one I found http://freebarcodefonts.dobsonsw.com/#Code128
Licensing info : http://freebarcodefonts.dobsonsw.com/Barcode_Font_Licensing.htm
which looks ok to me as he offers a freeware license. Would be worth
checking with him.
So now we just need to workout the encoding.
These links may be of use for this:
http://freebarcodefonts.dobsonsw.com/Code128Transformation.htm
PHP example http://www.mribti.com/barcode/download.php
Java http://www.pdflib.com/en/pdflib-cookbook/fonts-and-encodings/barcode-font/
http://www.openbarcode.org/wiki/Code_128_specification
http://code.google.com/p/barcode-generator/
http://www.itgens.cn/snippets/show/4482
So the options for us seem to be:
1) Convert the Perl / PHP scripts using GD to ruby using ruby-gd
2) Use the Code128 font and work out the character map
3) Use the Gbarcode creator to create the barcode and then insert into
PDF
I am betting the option 3 is the simplest but option 1 would be the
coolest :)
Option 2 might work depending on the license.
On Nov 7, 7:42 am, MagpieUK <irvin...@gmail.com> wrote:
> I posted the query into the ruby mailing list and they suggested we
> look at using a code 128 font.
>
> So here is one I foundhttp://freebarcodefonts.dobsonsw.com/#Code128
>
> Licensing info :http://freebarcodefonts.dobsonsw.com/Barcode_Font_Licensing.htm
> which looks ok to me as he offers a freeware license. Would be worth
> checking with him.
>
> So now we just need to workout the encoding.
>
> These links may be of use for this:
>
> http://freebarcodefonts.dobsonsw.com/Code128Transformation.htm
> PHP examplehttp://www.mribti.com/barcode/download.php
> Javahttp://www.pdflib.com/en/pdflib-cookbook/fonts-and-encodings/barcode-...
It saves the file into the public directory in a barcode directory so
it can easily be accessed. Rather than an ActionView::Base extension I
also added a ActionController::Base extension so in the controller i
can simply say barcode 'MAGPIEUK', :encoding_format =>
Gbarcode::BARCODE_128
http://baobab-volunteers.googlegroups.com/web/MAGPIEUK.png
It should be a relatively simple PDF action to include the image in
the file. Will look at this next.
http://tom.harding.free.fr/downloads/code128barcode/
So we may now have an option 4 :)
As for scaling we can pass a height and width to the barcode function
so we can probably make them what ever size we need.