There are 3 possible options for printing barcodes in 4D. The easiest way is to paste a picture of the barcode onto a form. This is only practical however if you have a barcode that does not change, but it is not very realistic if the bar code changes often.
For most situations, a barcode font is used generate a bar code. A barcode font is assigned to a field or variable and when the field or variable is displayed or printed, the barcode is displayed instead of the usual letters or numbers. The barcode font usually needs to be a Type 1 Postscript font or a True type font to work correctly with Mac and Window Operating Systems and most printers. Consult the printer manual for what types of fonts it will support. A search of any major internet search site for "barcode font" will return a large selection of companies that provide barcode fonts.
Your final option is to use an industrial label printer that has its own built in bar code fonts. For these printers, consult the manual for the data format the printer needs to use the built in fonts.