Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
DynaPDF.InsertBarcode
Inserts a barcode to the current open page.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 10.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example |
---|---|---|
The PDF reference returned from DynaPDF.New. | ||
JSON | The JSON describing the barcode. |
Result
Returns OK or error.
Description
Inserts a barcode to the current open page.JSON may include:
Parameter | Description | Default |
BarcodeType | The type of barcode that should be created. Pass name or number. | |
BgColor | Background color | NO_COLOR (transparent) |
BorderWidth | Border width | 0 |
Data | Required: Data string. | |
DataType | Data type and escape flag. Pass data type as text or number. | |
DotSize | Dotty mode only | 4.0/5.0 |
Eci | Extended Channel Interpretation mode | 0 |
FgColor | RGB Foreground color | |
FSizeFactor | Font size correction factor | 0.7 |
Option1 | Various, depends on barcode type. | -1 |
Option2 | Various, depends on barcode type. | 0 |
Option3 | Various, depends on barcode type. | 0 |
Options | Output options. Pass value as text list of flags or number. | |
Orientation | Supported values: 0, 90, -90, 180, -180, 270, -270. | |
Primary | Composite codes only. Primary data message (max 127 bytes). Image based barcodes only. | |
Scale | Image based barcodes only. | 1.0 |
ShowText | Show human readable text? | true |
SpaceWidth | Whitespace width in pixels | 0 (auto). |
SymbHeight | Symbol height | 50 |
TextOffsetY | Offset to correct the y-coordinate of text | 0 |
PosX | X-Coordinate of destination rectangle | |
PosY | Y-Coordinate of destination rectangle | |
Width | Width of destination rectangle | |
Height | Height of destination rectangle | |
HAlign | Horizontal alignment | |
VAlign | Vertical alignment |
Name | Code | Description |
AustraliaPost | 0x003F | Australia Post Standard Customer |
AustraliaRedir | 0x0044 | Australia Post Redirection |
AustraliaReply | 0x0042 | Australia Post Reply Paid |
AustraliaRout | 0x0043 | Australia Post Routing |
Aztec | 0x005C | Aztec Code |
AztecRunes | 0x0080 | Aztec Runes |
C2Of5IATA | 0x0004 | Code 2 of 5 IATA |
C2Of5Industrial | 0x0006 | Code 2 of 5 Industrial |
C2Of5Interleaved | 0x0003 | Interleaved 2 of 5 |
C2Of5Logic | 0x0005 | Code 2 of 5 Data Logic |
C2Of5Matrix | 0x0002 | Standard Code 2 of 5 |
ChannelCode | 0x008C | Channel Code |
Codabar | 0x0012 | Codabar |
CodablockF | 0x004A | Codablock-F |
Code11 | 0x0001 | Code 11 |
Code128 | 0x0014 | Code 128 (automatic subset switching) |
Code128B | 0x003C | Code 128 (Subset B) |
Code16K | 0x0017 | Code 16K |
Code32 | 0x0081 | Code 32 |
Code39 | 0x0007 | Code 3 of 9 (Code 39) |
Code49 | 0x0018 | Code 49 |
Code93 | 0x0019 | Code 93 |
CodeOne | 0x008D | Code One |
DAFT | 0x005D | DAFT Code |
DataBarOmniTrunc | 0x001D | GS1 DataBar-14 Omnidirectional and truncated / RSS14 |
DataBarExpStacked | 0x0051 | GS1 DataBar Expanded Stacked |
DataBarExpanded | 0x001F | GS1 DataBar Expanded / RSS_EXP |
DataBarLimited | 0x001E | GS1 DataBar Limited / RSS_LTD |
DataBarStacked | 0x004F | GS1 DataBar-14 Stacked |
DataBarStackedO | 0x0050 | GS1 DataBar-14 Stacked Omnidirectional |
DataMatrix | 0x0047 | Data Matrix ECC200 |
DotCode | 0x0073 | DotCode |
DPD | 0x0060 | DPD code |
DPIdentCode | 0x0016 | Deutsche Post Identcode |
DPLeitcode | 0x0015 | Deutsche Post Leitcode |
EAN128 | 0x0010 | GS1-128 (UCC.EAN-128) |
EAN128_CC | 0x0083 | Composite Symbol with GS1-128 linear component |
EAN14 | 0x0048 | EAN-14 |
EANX | 0x000D | EAN |
EANX_CC | 0x0082 | Composite Symbol with EAN linear component |
EANXCheck | 0x000E | EAN + Check Digit |
ExtCode39 | 0x0008 | Extended Code 3 of 9 (Code 39+) |
FIM | 0x0031 | FIM |
Flattermarken | 0x001C | Flattermarken |
HIBC_Aztec | 0x0070 | HIBC Aztec Code |
HIBC_CodablockF | 0x006E | HIBC Codablock-F |
HIBC_Code128 | 0x0062 | HIBC Code 128 |
HIBC_Code39 | 0x0063 | HIBC Code 39 |
HIBC_DataMatrix | 0x0066 | HIBC Data Matrix ECC200 |
HIBC_MicroPDF417 | 0x006C | HIBC MicroPDF417 |
HIBC_PDF417 | 0x006A | HIBC PDF417 |
HIBC_QR | 0x0068 | HIBC QR Code |
ISBNX | 0x0045 | ISBN (EAN-13 with verification stage) |
ITF14 | 0x0059 | ITF-14 |
JapanPost | 0x004C | Japanese Postal Code |
KIX | 0x005A | Dutch Post KIX Code |
KoreaPost | 0x004D | Korea Post |
LOGMARS | 0x0032 | LOGMARS |
Mailmark | 0x0079 | Royal Mail 4-State Mailmark |
Maxicode | 0x0039 | Maxicode |
MicroPDF417 | 0x0054 | Micro PDF417 |
MicroQR | 0x0061 | Micro QR Code |
MSIPlessey | 0x0047 | MSI Plessey |
NVE18 | 0x004B | NVE-18 |
PDF417 | 0x0037 | PDF417 |
PDF417Truncated | 0x0038 | PDF417 Truncated |
PharmaOneTrack | 0x0033 | Pharmacode One-Track |
PharmaTwoTrack | 0x0035 | Pharmacode Two-Track |
PLANET | 0x0052 | PLANET |
Plessey | 0x0056 | Plessey |
PostNet | 0x0028 | PostNet |
PZN | 0x0034 | PZN |
QRCode | 0x003A | QR Code |
RMQR | 0x0091 | Rectangular Micro QR Code (rMQR) |
RoyalMail4State | 0x0046 | Royal Mail 4 State (RM4SCC) |
RSS_EXP_CC | 0x0086 | Composite Symbol with GS1 DataBar Extended component |
RSS_EXPSTACK_CC | 0x008B | Composite Symbol with GS1 DataBar Expanded Stacked component |
RSS_LTD_CC | 0x0085 | Composite Symbol with GS1 DataBar Limited component |
RSS14_CC | 0x0084 | Composite Symbol with GS1 DataBar-14 linear component |
RSS14Stacked_CC | 0x0089 | Composite Symbol with GS1 DataBar-14 Stacked component |
RSS14StackOMNI_CC | 0x008A | Composite Symbol with GS1 DataBar-14 Stacked Omnidirectional component |
Telepen | 0x0020 | Telepen Alpha |
TelepenNumeric | 0x0057 | Telepen Numeric |
Ultracode | 0x0090 | Ultracode |
UPCA | 0x0022 | UPC A |
UPCA_CC | 0x0087 | Composite Symbol with UPC A linear component |
UPCACheckDigit | 0x0023 | UPC A + Check Digit |
UPCE | 0x0025 | UCP E |
UPCE_CC | 0x0088 | Composite Symbol with UPC E linear component |
UPCECheckDigit | 0x0026 | UPC E + Check Digit |
UPNQR | 0x008F | UPNQR (Univerzalni Placilni Nalog QR) |
USPSOneCode | 0x0055 | USPS OneCode |
VIN | 0x0049 | Vehicle Identification Number (America) |
Name | Value | Description |
Binary | 0 | Binary data. |
Unicode | 1 | UTF-8. |
GS1Mode | 2 | Encodes GS1 data using FNC1 characters. |
EscapeMode | 8 | Scan input data for escape sequences. This is a flag that can be combined with the other constants, e.g. pass EscapeMode and Unicode. |
Name | Value | Description |
Default | 0x00000000 | Use default settings. |
NoASCII | 0x00000001 | Consider non-ASCII characters when creating the barcode. |
Bind | 0x00000002 | Boundary bars above and below the symbol and between rows if stacking multiple symbols. |
Box | 0x00000004 | Add a box surrounding the symbol and whitespace. |
ReaderInit | 0x00000010 | Add a reader initialisation symbol to the data before encoding. |
SmallText | 0x00000020 | Use a smaller font for human readable text. |
BoldText | 0x00000040 | Embolden human readable text. |
DottyMode | 0x00000100 | Plot a matrix symbol using dots rather than squares. |
GS1_GS_Separator | 0x00000200 | Use GS instead FNC1 as GS1 separator. |
ImageOutput | 0x01000000 | Draw the barcode as an image. Images are usually larger than vectors and require more processing time. |
UseActiveFont | 0x02000000 | Vector output only. If set, text is output with the active font. Helvetica is used otherwise. |
See also InsertBarcode function in DynaPDF manual.
Examples
Insert QR-Code:
Set Variable [ $json; Value: MBS( "DynaPDF.GetDefaultBarcodeParameters" ) ]
Set Variable [ $json; Value: JSONSetElement ( $json ; "BarcodeType" ; "QRCode"; JSONString ) ]
Set Variable [ $json; Value: JSONSetElement ( $json ; "Data" ; "Hello World"; JSONString ) ]
Set Variable [ $json; Value: JSONSetElement ( $json ; "PosX" ; 300; JSONNumber ) ]
Set Variable [ $json; Value: JSONSetElement ( $json ; "PosY" ; 300; JSONNumber ) ]
Set Variable [ $json; Value: JSONSetElement ( $json ; "Width" ; 200; JSONNumber ) ]
Set Variable [ $json; Value: JSONSetElement ( $json ; "Height" ; 50; JSONNumber ) ]
Set Variable [ $r; Value: MBS( "DynaPDF.InsertBarcode"; $pdf; $json ) ]
Add QR Code to a page on bottom right:
# draw barcode
Set Variable [ $r ; Value: MBS("DynaPDF.EditPage"; $pdf; 1) ]
Set Variable [ $json ; Value: MBS( "DynaPDF.GetDefaultBarcodeParameters" ) ]
Set Variable [ $json ; Value: JSONSetElement ( $json ; "BarcodeType" ; "QRCode"; JSONString ) ]
Set Variable [ $json ; Value: JSONSetElement ( $json ; "Data" ; "Hello World"; JSONString ) ]
Set Variable [ $json ; Value: JSONSetElement ( $json ; "PosX" ; MBS("DynaPDF.GetPageWidth"; $pdf) - 80; JSONNumber ) ]
Set Variable [ $json ; Value: JSONSetElement ( $json ; "PosY" ; 20; JSONNumber ) ]
Set Variable [ $r ; Value: MBS( "DynaPDF.InsertBarcode"; $pdf; $json ) ]
Set Variable [ $r ; Value: MBS("DynaPDF.EndPage"; $pdf) ]
See also
- Barcode.DrawBarcode
- DynaPDF.EditPage
- DynaPDF.EndPage
- DynaPDF.GetDefaultBarcodeParameters
- DynaPDF.GetPageWidth
- DynaPDF.New
Release notes
- Version 11.3
- Added OuterBorderTop, OuterBorderLeft, OuterBorderRight and OuterBorderBottom for DynaPDF.GetDefaultBarcodeParameters and DynaPDF.InsertBarcode functions.
- Changed DynaPDF.GetDefaultBarcodeParameters and DynaPDF.InsertBarcode to work with older and newer DynaPDF libraries.
- Version 10.5
- Added DynaPDF.DrawNGon, DynaPDF.GetDefaultBarcodeParameters and DynaPDF.InsertBarcode functions.
Example Databases
Blog Entries
- MBS FileMaker Plugin, version 11.3pr7
- Things you can do with DynaPDF
- MBS FileMaker Plugin, version 11.3pr1
- New in MBS FileMaker Plugin 10.5
- Neues MBS FileMaker Plugin 10.5 - Über 6400 Funktionen in einem Plugin
- MBS FileMaker Plugin 10.5 - More than 6400 Functions In One Plugin
- MBS FileMaker Plugin, version 10.5pr1
- Embrace JSON
FileMaker Magazin
This function checks for a license.
Created 18th September 2020, last changed 25th August 2022