How to use [image.generate-qr]

The reference page of image.generate-qr has its arguments, constraints and declaration.

You can use the [image.generate-qr] slot to create a QR code. This slot returns the QR code as a MemoryStream, which allows you to return its output directly over the HTTP response object, which again will persist the QR code back as the response to the caller if you’re in a web project of some sort using Magic. The slot takes two arguments.

  • Value of node - Mandatory string, or an expression leading to a string, which is to become the content of the generated QR code
  • [size] - Optional argument declaring the size of your QR code

Below is an example of usage

image.generate-qr:"https://docs.ainiro.io"
   size:8

After execution, the above invocation slot will contain a MemoryStream encapsulating your underlying QR code. Below is an example QR code generated by the library.

QR Code