YOUSEFUL / FILEMAKER

Youseful Barcode: FAQ, examples and tutorial

Learning center · Function reference

Use YsflBarcode.fmx64 to generate linear and two-dimensional codes. The tutorial stores a PNG directly in a FileMaker container; it needs no image file or font.

FAQ

Can it read a barcode from a camera or image? This version generates codes; scanning and decoding are not included.

Is Generate's result text? No. Generate returns a PNG container. GenerateSVG returns SVG text. Choose the correct field type for the output you want.

Does Validate return 1 for valid data? It returns empty text when the data encodes successfully; otherwise it returns an encoder message without a leading question mark. Do not apply the usual numeric-success convention to it.

How do I control image size? scale=N controls pixels per module; ImageSize reports the resulting pixel dimensions. Preserve quiet zones and scan-test the actual printed label at its intended size.

Examples

Validate a twelve-digit EAN-13 input, allowing the encoder to supply its check digit:

filemaker
YsflBc_Validate ( "EAN13" ; "590123412345" )

Result: empty text. YsflBc_CheckDigit ( "EAN13" ; "590123412345" ) returns 7.

Generate a scalable code as text:

filemaker
YsflBc_GenerateSVG ( "Code128" ; "YSFL-001" ; "text=0" )

Result: SVG markup, not a container. Store it in text or write it to an .svg file.

Tutorial

Standalone sample scripts: Make a QR code.

Goal: create a QR code in a container field.

  1. In a practice file, create a table occurrence Demo with a Container field QR. Put the field on a layout and create one record.
  2. Create a script named Youseful - Make a QR code:
filemaker
Set Variable [ $payload ; Value: "Youseful Software demo" ]
Set Variable [ $validation ; Value: YsflBc_Validate ( "QR" ; $payload ; "ecc=M scale=4" ) ]
If [ not IsEmpty ( $validation ) ]
    Show Custom Dialog [ "Invalid barcode data" ; $validation ]
    Exit Script [ Text Result: $validation ]
End If
Set Variable [ $image ; Value: YsflBc_Generate ( "QR" ; $payload ; "ecc=M scale=4 name=youseful-qr.png" ) ]
Set Variable [ $error ; Value: YsflBc_LastError ]
If [ $error <> 0 ]
    Show Custom Dialog [ "Generation failed" ; YsflBc_LastErrorText ]
    Exit Script [ Text Result: "Generation failed" ]
End If
Set Field [ Demo::QR ; $image ]
  1. Run the script on the Demo layout. A black-and-white QR image should appear.
  2. Scan the displayed or printed image with a separate QR reader. It should decode to Youseful Software demo.

Troubleshooting

If you see a filename without an image, confirm that the destination is a container field configured to display its content. If an EAN/UPC fails validation, check its digit count and check digit. A code's successful generation does not guarantee readability after resizing, cropping or printing.