in a grails application I need to generate a PDF417 i开发者_如何学运维mage and send it via email. Can anybody recommend me a (hopefully free) grails plugin or java library?
The barcode4j plugin (http://grails.org/plugin/barcode4j) uses barcode4j which has support for PDF417 among others.
Here's a sample controller action that would generate an image and render it to the browser:
import org.krysalis.barcode4j.impl.pdf417.PDF417Bean
class TestController {
def index = {
def generator = new PDF417Bean()
generator.height = 10
def barcodeValue = "12345"
renderBarcodePng(generator, barcodeValue)
}
}
For the "send it via email" part of your feature, I recommend the mail plugin. The documentation explains how to configure and use it.
精彩评论