Scanning barcodes in FileMaker is very easy. We can use a barcode scanner as keybord input or in FM Go we can even use the iPhone’s camera to scan barcodes and put the result directly in one of our fields. But generating the barcodes was not that easy… till now!
Meet the EasyBarcode custom function. Yes, its just a custom function! In fact, the only two things you need is the custom function and a webviewer!
Update: 2016.03.21: EasyBarcode v2: Possibility to save the barcode as PNG in container!
Update: 2016.09.09: EasyBarcode v2.1: saving as PNG also works on Windows now!
Update: 2017.06.27: EasyBarcode v2.2: works in FM16 now. ( new ‘extended privilege set’: fmurlscript )
Update: 2017.12.15: EasyBarcode v2.3: rotate barcode 90° and EAN13 barcode also takes 12 digit values.
Check the filemaker file: EasyBarcode_20171215a.fmp12 for the latest version of the custom function.
This is what you do:
1. Place a webviewer on your layout.
2. Put the EasyBarcode custom function in the webviewer.
3. Pass a value to the EasyBarcode custom function. ( You probably want to feed it a field value )
Easy but Powerful
When passing only a value to the EasyBarcode custom function, it generates a CODE128 barcode with following default specs: width = 1 px, height = 40 px, quite zone = 0 px, value displayed, white backgroundcolor and black barcode bars.
How it works?
New in version 2: save barcode as PNG in container!
How? You can now specify a new parameter: script, in the custom function.
This script will be triggered in your file when the barcode is generated. The barcode is passed as a base64 string. The string is then decoded and saved as a picture in a container field with the result below: the barcode in a container!