How can I inject a dynamically generated image (barcode, as it happens) into a PDF document (I'm in rails if that matters)?

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-08 04:57:05

问题


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.


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/13442419/how-can-i-inject-a-dynamically-generated-image-barcode-as-it-happens-into-a-p

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!