web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Create QR codes from AX

PA-22040759-0 Profile Picture PA-22040759-0 6,194
It seems like the Brazilian authorities are very modern in their approach to how you report to and communicate with them. I have found several neat things in AX from the Brazil specific features.

This time I stumbled over an assembly called QRCode and I thought I should look into what that was used for. It turns out you can create QR codes from AX pretty easy. Here is an example:
static void JobCreateQRCode(Args _args)
{
Image image;
container imageContainer;
str url;
EFDocQRCode_BR qrCode;

// The url to create the QR code. Could also for example be an e-mail address
url = 'http://www.agermark.com';

// Create an instance of the QR code class
qrCode = new EFDocQRCode_BR();

// Generate a QR code for the URL and save the result to a container
imageContainer = qrCode.generateQRCode(url);

// Use AX's good old Image class to load the image from the container
// and save it as a file
image = new Image();
image.setData(imageContainer);

image.saveImage("F:\QrCode.jpg", ImageSaveType::JPG);
}
You can now open the file and see the resulting QR code.

It links to www.agermark.com. Which leads me to the thing I really don't understand about QR codes. For security reasons we are always told not to click an URL that doesn't seem familiar. But scanning QR codes having absolute no idea about where they lead to is perfectly alright. Go figure.

Comments

*This post is locked for comments