|
From: Guillaume P. <gpo...@gm...> - 2011-10-15 12:25:21
|
Hi, yes I guess it also works, but I think both approaches are still hacks... I think the correct solution would be to have a new method in the API that accepts binary data as a byte array. But it seems it would require quite a lot of work. Regards, g On 12 October 2011 06:45, Jeremias Maerki <de...@je...> wrote: > Hi Guillaume > > Thanks for your patch! That's interesting but I'd rather not introduce yet > another mechanism for submitting binary data. DataMatrix already has > one: binary data encoded using RFC 2397 data URLs as messages. See: > http://barcode4j.sourceforge.net/2.1/symbol-datamatrix.html#Message+format > > I'm sure that can easily be fit into PDF417, too. WDYT? > > On 10.10.2011 16:48:59 Guillaume Pothier wrote: >> Hi, >> For a project I needed to use a specific text encoding for the message >> in a pdf417 barcode. The idea is to encode the message with that >> encoding and then use the byte compaction to store the encoded string. >> However, adding the ability to pass the message as a byte array looks >> quite involved, as it means adding new APIs (AFAICT), so I went >> through another route: I added an "encoding" configuration parameter >> to the PDF417 bean, and an "encoding" argument to the >> PDF417LogicImpl.generateBarcodeLogic and >> PDF417HighLevelEncoder.encodeHighLevel methods. If the encoding is >> null, the default compaction and encoding are used. If the encoding is >> not null, the string is encoded and byte compaction is used to >> represent the message. >> I attach a preliminary version of the patch, in case somebody finds it >> useful. I can improve it if requested. >> Obviously, the ideal solution would be to be able to specify the >> message as a byte array for the barcodes that support it. >> >> Kind regards, >> g > > > > > Jeremias Maerki > > |