Highlighted

[AC6.1.1] Changing display properties in QR Barcode

sqwgglz

18-10-2018

Hi guys,

Wondered if anyone has had any success changing the current white and black QR codes into something different: say a white code on a dark blue background.

Also does anyone know if there’s a border built into the generated QR code image or not?

Thanks!

Kevin

Replies

Highlighted

Jean-Serge_Biro

MVP

19-10-2018

Hi sqwgglz,

Currently the QR code inserted in a delivery (through the module custom link inserted in the delivery body) is generated as an image file link, thanks to the server-side barcode.jsp script. And the parameters for the custom link setting how the image must be generated are the type of barcorde (QR, EAN128, etc), the size, resolution. The color is not a factory parameter.

So the only solution could be to adapt the  barcode.jsp file located on server-side.
You can read the Java Server page code, it is pretty understandable. But I recommend to duplicate the barcode.jsp and modify the duplicated file, in order to keep safe / maintenance by Adobe for out of the box module.
If you are On Premise hosting, you can achieve this change by your own.

Alternative: ask Adobe for an evolution of the barcode module, with additional parameters.

Regards
J-Serge

Highlighted

david_garcia1

MVP

19-10-2018

The QRcode in Adobe Campaign is generated  with zxing  java library through the barcode.jsp script as Serge mentioned.

The following isn't likely to work, just use a reference for adaptation.

In line 310, you need to adapt the code to include color code arguments, obviously remember to backup the file because it will be overwritten on any upgrades.

Looking at some online examples, it is something along these lines.

reference extra class add it after line 40

com.google.zxing.client.j2se.MatrixToImageConfig

line 310 add method to pull MatrixToImageConfig params

and need to add the methods

references

https://aboullaite.me/generate-qrcode-with-logo-image-using-zxing/

https://www.programcreek.com/java-api-examples/index.php?api=com.google.zxing.client.j2se.MatrixToIm...

ZXing Project · GitHub

MatrixToImageWriter (ZXing 3.3.3 API)

Method Summary

Modifier and TypeMethod and Description
static BufferedImagetoBufferedImage(BitMatrix matrix)

Renders a BitMatrix as an image, where "false" bits are rendered as white, and "true" bits are rendered as black.

static BufferedImagetoBufferedImage(BitMatrix matrix, MatrixToImageConfig config)

As toBufferedImage(BitMatrix), but allows customization of the output.

Highlighted

sqwgglz

29-10-2018

Thanks for your help guys.

Didn't think this was something we can request. How do you ask Adobe for this? Through neolane support?

Highlighted

david_garcia1

MVP

29-10-2018

Yes you can raise it through Neolane Support, however, it is likely to be assigned to Professional Services and this is billable, you can contact you account manager to find out more.