[英]Having problems while generating barcode in rails using BARBY gem
I am using: 我在用:
I'm having problems to generate barcodes for my app. 我在为我的应用程序生成条形码时遇到问题。 I installed barby 0.5.0 and I was hoping that it would solve my problems.
我安装了barby 0.5.0,希望它能解决我的问题。 But everytime it generates a file, it seems that it's broken or damaged.
但是,每次生成文件时,它似乎都已损坏或损坏。 It can't be opened.
无法打开。 I wonder what I'm doing wrong here.
我想知道我在做什么错。
As for the stack trace, there's really no error. 至于堆栈跟踪,实际上没有错误。
Here's my code: 这是我的代码:
barcodevalue = "00000000000"
full_path = "barcode#{barcode_value}.png"
barcode = Barby::Code39.new(barcode_value)
File.open(full_path, 'w') { |f| f.write barcode.to_png(:margin => 3, :xdim => 2, :height => 55) }
render :text => "#{barcode_value}.png has been generated."
Please see this link for answer. 请查看此链接以获取答案。
https://groups.google.com/forum/#!topic/ruby-barby/8Vgh-CLNfuI https://groups.google.com/forum/#!topic/ruby-barby/8Vgh-CLNfuI
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.