2

I'm aware of pdf-stamper, but I'm trying to avoid switching everything to jruby right now.

I just need to "stamp" an image that I generate within the rails app (a PDF417 barcode) into a form field in the PDF document (there's an FDF; it's a document template kinda thing).

I'm filling out the text-based fields by just shelling out to pdftk, so if there's a way to do it using pdftk, I'd be fine with that, but I've looked high and low for one without any luck.

Troy
  • 710
  • 1
  • 10
  • 18

2 Answers2

1

How about using a barcode font? some alternatives too. I haven't used that one but there may be others available too

Stephen Connolly
  • 13,872
  • 6
  • 41
  • 63
  • I didn't know barcode fonts existed. They look great, but I ended up needing some other features that pdf-stamper provides, and just used rjb to run it without migrating everything over to jruby. Works great. Still, barcode font is probably the right answer for most people, I'd think, so this one gets a green check mark. Also because it is the only answer... – Troy Dec 02 '12 at 04:49
0

I know I'm late to the party, but the PDF417 Rubygem should do what you need. https://rubygems.org/gems/pdf417 will generate it and if you have chunky_png installed you can easily write out PNGs to a file.

James
  • 1,118
  • 7
  • 13
  • Thanks. Better late than never. I actually looked at this early on, but I wasn't sure how to get the .png file that the pdf417 gem generates "stamped" onto the PDF document. Apparently it's possible using ImageMagick or something, but (surprisingly?) RJB + the pdf-stamper gem turned out to work pretty well, so I never went any further down that road. – Troy Mar 28 '13 at 23:14