Media_CreateQRCode ( input {; level {; size {; frameThickness } } } )
Media_CreateQRCode creates a PDF container with a QR code representing the input. The generated QR code is black with a transparent background.
Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
input | Text to encode as a QR code. | ||||||||||
level | Optional. A numeric parameter in range 0…3 representing an error correction level. The higher the number, the more errorneous codewords can be tolerated. When the level parameter is not given, the default level is 0 i.e. when the parameter is either not given or empty "". Use higher level if you wish to place a small code-unrelated picture such as your logo in center of the code.
|
||||||||||
size | Optional. A numeric parameter specifying both width and height of the QR code. When the size parameter is not given or is empty “”, the default value is 144 points (2 inches). If you plan to use the QR code in FileMaker, you can also scale the container content in the Data Formatting pane > Format > “Reduce or enlarge image to fit”. The generated QR code is a vector PDF file with a PNG preview and will scale. | ||||||||||
frameThickness | Optional. A parameter specifying thickness of a frame around the generated code. When frameWidth is not given, 0, or empty (“”), there is no frame. The default value is 0 pixels. |
Returns
The generated QR code or an empty container in case of an error. If the container is empty, use the Media_GetLastError function to obtain more information about character of the error.
Examples
Typical uses of QR codes include encoding an HTTPS URL or simplifying an online payment onto a bank account.
URL QR code
My Table::QRCode ;
Media_CreateQRCode ( "https://www.1stplugins.com" ; 2 ) ]
Payment QR code
To generate a payment request QR code, you can use the Short Payment Descriptor (SPD) format and encode SPD text as a QR code. The SPD format consists of a header SPD*1.0 followed with a set of properties delimited with an asterisk *. Each property has a name and value delimited with a colon. For example, the following SPD text:
SPD*1.0*ACC:CZ8120100000002500184204+FIOBCZPPXXX*AM:1.00*CC:USD*MSG:Payment for the goods
Contains a mandatory SPD*1.0 header, an account number as IBAN with an optional “+” SWIFT code ACC:CZ8120100000002500184204+FIOBCZPPXXX, amount to be transferred with two fractional figures AM:1.00, currency of the amount as a US Dollar CC:USD, and a message for the beneficiary: MSG:Payment for the goods.
$vSPD; "SPD*1.0*ACC:CZ8120100000002500184204+FIOBCZPPXXX*AM:1.00*CC:USD*MSG:Payment for the goods"
MyTable::QRCode; Media_CreateQRCode ( $vSPD ) ]
More information about the SPD can be found here: https://en.wikipedia.org/wiki/Short_Payment_Descriptor.