Copyright: ® dLSoft 1993-5


Help Contents
Contents

Introduction.

dBarcode - Barcodes for Windows

Using dBarcode

Creating a barcode image

Copying a barcode image to the  Windows Clipboard.

Saving a barcode image as a WMF file

Notes on Metafiles

Reference

The dBarcode Window

Menu Reference

Command Reference

Dialogs


dBarcode - Barcodes for Windows

dBarcode is a Windows utility which enables barcode images to be created and copied to the clipboard for pasting into other Windows applications.

dBarcode images are created as Windows Metafiles. These are continuously scalable and maintain a high quality at any size.

While most barcodes are used as black bars on a white background, dBarcode does provide the option of selecting both foreground (bar) and background colours, and dBarcode can display the code text below the barcode using a font of your choice.

More:

Barcode types


Barcode types

Details of the types of barcodes supported are contained in the Barcodes HELP system which accompanies dBarcode. This HELP system is updated at the same time as the barcode library.


Creating a barcode image

The procedure for creating a barcode image is simple:

1.	Choose the type of barcode from the combo box in the Control Panel just below the menu.

2.	Check that the Checksum item of the options menu is set as required.
The item is checked if dBarcode's automatic checksum calculation facility has been enabled. The number of characters required in a barcode may depend on whether an automatic checksum calculation is to be performed.

3.	Enter the required code into the code box - also in the Control Panel.
The Characters required box specifies how may characters are required for the chosen barcode type. If 0 is displayed then any number of characters may be entered. The Characters provided box display the number of characters currently entered into the code box.

4.	If you wish the code to be displayed as text under the barcode then the Text item of the Options menu must be checked.

5.	The Foreground and Background colours used for the barcode image, the thickness of any border around the barcode, and the font used for the code text may be modified by selecting the relevant item from the Options menu.

Notes:

If the display shows no barcode this may be because the code you have entered is not legal for the codetype you have selected. This may be because the number of characters is not correct, or because you have included spaces or illegal characters (such as alphabetic characters in a numeric coding scheme, or characters in the wrong case). The Status box will show the reason why the image has not been created. Check the code in the code box and try again.

If no image is visible it may be because the foreground and background colours have been set to the same colour.

If you wish to create a barcode image which will occupy a particular size, then choose Target Size from the Options menu and enter the required height and width in millimetres.

If you wish to copy the barcode image to the clipboard choose Copy from the Edit menu.


Copying a barcode image to the
Windows Clipboard.

The barcode image displayed within the dBarcode window may be copied to the clipboard by selecting the Copy item of the EDIT menu, or by pressing <Ctrl><Ins>.

The image placed on the clipboard is a Picture (metafile). This may be pasted into most Windows applications which accept metafile Pictures.

Copying an image to the clipboard replaces any previous image stored on the clipboard.


Saving a barcode image as a WMF file

The barcode image displayed within the dBarcode window may be saved as a Windows Placeable Metafile (.WMF) by selecting Save Image from the FILE menu.

The Windows Save file dialog appears, prompting the user to enter a file name, and, if necessary, to select an appropriate drive and directory in which to save the file.

The WMF files may be loaded directly into applications such as Word for Windows.


Notes on Metafiles

The picture images placed on the clipboard by dBarcode are ANISOTROPIC metafiles. This means that they can be resized within applications (usually by dragging a corner).

While the barcode bars can be resized over very wide ranges, any text included within the image may not resize as expected. In general changing the height of the image by resizing within another application will change the fontsize used to render the text. Changing the width of the image within another application may cause the position of any text under the barcode to change.

To overcome textsize problems caused by resizing metafile images choose an alternative fontsize within dBarcode. The use of TrueType fonts is recommended to prevent unusual effects caused by resizing of text.

Using the Target Size dialog and setting height and width values for the final image is useful in ensuring that an appropriate fontsize is used for the image. The dBarcode window will display the image as it would appear at the target size.

Note that those barcodes which have a nominal size (eg the EAN-13 and EAN-8 codes) may be placed on the clipboard as metafiles with the correct height to width ratio by checking the Use Nominal Size checkbox in the Preferences dialog. When this checkbox is checked dBarcode will not use the Target Width value, but will use the Target Height value and derive the correct aspect ratio from the nominal size. This, however, does not prevent the user from changing the aspect ratio by stretching the pasted image within another application.

Some older Windows applications do not correctly interpret Windows metafiles, and may align text incorrectly - generally placing the text to low on the image. To allow dBarcode,s metafiles to be used with such applications, the vertical position of text to be adjusted vertically by a percentage of the font height - see the Preferences dialog for details.


The dBarcode Window

The dBarcode window contains three areas of importance:

The Menu bar

The Control panel

The Image area

More:

Menu bar

Control panel

Image area


Menu bar

The Menu bar cotains the following items:

File	Provides file opening and saving facilities

Edit	Permits the barcode image to be copied to the clipboard

Options	Allows the image properties to be modified

Help	Provides access to the HELP system

Clicking on any item will cause the display of a pull-down menu which offers a list of related commands which may be given to dBarcode.


Control panel

The Control panel  shows information related to the image displayed in the Image area, and provides the user with a rapid means of modifying the two most frequently changed items of data (the barcode type and the barcode code)

More:

Code type box

Required characters box

Provided characters box

Code box

Status box

Checksum box


Code type box

This drop-down listbox contains the abbreviated names of all the barcode type supported by dBarcode. The top line displays the code type currently selected (which defaults to Code 39). To change the selection to another code type click on the arrow at the left of the box and select one of the displayed types by clicking on its name. A scroll bar at the side of the list allows more items to be scrolled into view. See the Barcodes HELP system for details on the supported code types.


Required characters box

This shows the number of characters required for the currently selected code type. Codes which allow any number of characters display 0 in this box.


Provided characters box

This shows the number of characters currently displayed on the Code line.


Code box

This is a standard edit box into which the characters which will be used to create the barcode must be entered by the user. The usual Windows editing actions may be undertaken in this box (ie. <Ctrl><Ins> copies any selected tect to the clipboard; <Shift><Ins> pastes any text on the clipboard into the box at the current cursor position).


Status box

This box displays a status message which is generated when dBarcode attempts to create a barcode image. For a correctly formed barcode the status should display the message "OK". When a barcode cannot be created the status box will contain one of the following error messages:

Invalid character

Incorrect length


Checksum box

The final box on the control panel displays the checksum status of  the currently selected codetype - or is blank for codetypes which do not support check digits. If the current checksum option is on (the Checksum item on the Options menu is checked) then dBarcode is responsible for calculating the check digits and the Checksum box displays the message "Automatic checksum". If the checksum option is off then the Checksum box displays the message "Manual checksum", and the user is responsible for entering the check digits along with the data in the Code box.


Image area

The Image area is that portion of the dBarcode window in which the barcode image is displayed. The image area may be viewed in outline by clicking  in the centre of the dBarcode window. The Image area is resized automatically as the dBarcode window is resized, and cannot otherwise be altered. The image area will be displayed using a size which is the best fit within the dBarcode window, while maintaining the height to width ratio specified in the Target Size settings.

When a background colour is chosen, then the image area is painted with the background colour before the barcode image is drawn using the foreground colour. If a border size is provided, then that size represents the distance (in printers' Points) which will be left between the edge of the barcode picture and the edge of the image area.

When a Copy operation is performed the whole image area is copied to the clipboard.


Menu Reference

File Menu

Edit Menu

Options Menu


File Menu

The File menu includes commands that enable you to open and save a dBarcode configuration, or exit.

Load	Load a named configuration file

Save	Save the current configuration in a named file

Save Defaults	Save the current configuration as a default configuration

Save Image	Save the current image as a WMF file

Exit	Close dBarcode


Edit Menu

The Edit menu contains a single command that enable you to copy the current Barcode image to the Windows Clipboard.

Copy	Copy Image to clipboard


Options Menu

The Options menu includes commands that enable you to modify the Barcode image.

Redraw	Redraw the current barcode image.

Target Size	Set the target size for the barcode image.

Border	Specify size of border around barcode image.

Background	Choose the colour used for the image background

Foreground	Choose the colour used for the image foreground (ie. the bars and text).

Orientation	Set the orientation of the barcode image.

Font	Choose the Font used for displaying text under the barcode.

Checksum	Toggle dBarcode's automatic checksum facility.

Text	Toggle dBarcode's text display facility.

Preferences	Set the special options which effect the image.


Command Reference

File Load Command

File Save Command

File Save Defaults Command

File Save Image Command

File Exit Command

Edit Copy Command

Options Redraw Command

Options Target Size Command

Options Border Command

Options Background Command

Options Foreground Command

Options Orientation Command

Options Font Command

Options Checksum Command

Options Text Command

Options Preferences Command


File Load Command

Displays the Open file dialog box, which allows the user to select a configuration file for opening. The dialog box shows the list of configuration file names available in the current directory, using the default extension .BRM.

An alternative drive and/or path may be selected from the drive and directory combo-boxes.


File Save Command

Displays the Save file dialog box, which allows the user to name a file for saving the current configuration.

An alternative drive and/or path may be selected from the drive and directory combo-boxes.

Configuration files are automatically saved with the extension .BRM unless an alternative extension is explicitly included in the filename.


File Save Defaults Command

Saves the current configuration into a file named BARMAN.INI within the dBarcode directory.

When dBarcode is initially loaded it searches for a file named BARMAN.INI and uses the configuration therein to set initial parameters.


File Save Image Command

The barcode image displayed within the dBarcode window may be saved as a Windows Placeable Metafile (.WMF) by selecting Save Image from the FILE menu.

The Windows Save file dialog appears, prompting the user to enter a file name, and, if necessary, to select an appropriate drive and directory in which to save the file.

The WMF files may be loaded directly into applications such as Word for Windows.


File Exit Command

Once selected, and if the requested confirmation is give, the serial port is closed and dBarcode terminates.


Edit Copy Command

When the Copy menuitem chosen the current barcode image area displayed in dBarcode is copied to the clipboard as a metafile picture.

The Image on the clipboard may be viewed using a clipboard viewer, such as the CLIPBRD.EXE program supplied with Windows. The metafile may be pasted into most applications which can accept pictures.

Note that copying an image to the clipboard automatically erases the clipboard of any other information in picture format.


Options Redraw Command

Once selected, dBarcode redraws the barcode image based on the current code and options settings.


Options Target Size Command

When selected the Target Size dialog  box is displayed, allowing the user to enter height and width values (in millimetres) for the final image. Note that the metafile image produced by dBarcode may be resized independently of the target size, but that when resized any fontsize will also change.

Note that those barcodes which have a nominal size (eg the EAN-13 and EAN-8 codes) may be placed on the clipboard as metafiles with the correct height and width values by checking the Use Nominal Size checkbox with the Nominal size multiplier set to 100%. This however, does not prevent the user from changing the barcode size by stretching the pasted image within another application.

Barcodes may be scaled to a percentage of the nominal size by entering the required value in the multiplier edit box. Allowed values are 10 - 200%. Note, however, that the acceptable size range for most barcodes types which have nominal sizes is 80-120%.


Options Border Command

When selected, the Border size dialog box is displayed and allows the choice of a thickness (in Points) of a border between the barcode image and the edge of the image area.

The barcode image is automatically redrawn when the dialog is closed.


Options Background Command

When selected, the Colours dialog box is displayed and allows the choice of a colour with which the image background will be rendered when the barcode image is redrawn.

The barcode image is automatically redrawn when the dialog is closed.


Options Foreground Command

When selected, the Colours dialog box is displayed and allows the choice of a colour with which the image foreground (ie. the lines) and text font will be rendered when the barcode image is redrawn.

The barcode image is automatically redrawn when the dialog is closed.


Options Orientation Command

When selected a sub-menu is displayed offering the options for the orientation of the barcode image: Normal, left rotated and right rotated, and inverted. The currently selected option is ticked.

Selecting one of the options causes dBarcode to redraw the barcode image in the new orientation.

Note that some older application do not correctly handle the positioning of text which has been rotated. Also only TrueType or similar rotatable fonts may be used where text is to be included in a rotated image.


Options Font Command

When selected, the Font dialog box is displayed and allows the choice of a font which will be used to render the barcode text (if enabled) when the barcode image is redrawn.

The barcode image is automatically redrawn when the dialog is closed.

Note that only TrueType or similar rotatable fonts may be used where text is to be included in a rotated image.


Options Checksum Command

When this option is checked dBarcode automatically calculates the checksum digits of the code. Consequently checksum digits should not be entered by the user when this item is checked. dBarcode will modify the number which appears as Characters Required (just below the Menu bar) when the Checksum option is checked.

Note that for Code 128 and EAN-128 the checksum calculation is always automatic and the resulting characters are not displayed in human readable form. The features are specified by the EAN-128 standard.


Options Text Command

When this option is checked dBarcode will include the text form of the barcode under the barcode image - using the currently selected font properties to render the text.


Options Preferences Command

When selected the dBarcode Preferences dialog is displayed. This allows the user to specify:

1) whether Light Margin Indicators (> and < symbols) are displayed on those EAN codes for which they are recommended;

2) whether the checkdigit is included in text displays for those codes for which the display of check digit is optional [Note: the display of check digits is NOT optional for EAN and UPC codes];

3) a percentage amount (of the font height) by which text may be moved up. This provides a correction for some older applications which do not correctly align text in metafiles;

4) a percentage reduction which is used to reduce the thickness of all lines in the barcode. Any value between 0 and 50 may be entered. This facility may be used to compensate for ink spread following wet ink printing.


Dialogs

Colour dialog

Border Size dialog

Target Size dialog

File Open dialog

Font selection dialog

Preferences dialog

Save dialog


Colour dialog

The Colour dialog contains a number of boxes showing the colours available on your Windows system, with the currently selected colour highlighted. Clicking on a colour box selects that colour.

The Colours dialog also contains OK and Cancel buttons, both of which close the dialog. If the OK button pushed is the currently selected colour will be used for the item nominated when the dialog was called (ie. either the foreground colour or the background colour) and the barcode image redrawn, while if Cancel is pushed the current barcode image display remains unchanged.


Border Size dialog

The Border Size dialog contains an edit box which displays the size (in Points) of the current border around the barcode, and a vertical scrollbar which allows this value to be changed. (Alternatively a new value may be typed into the edit box directly.)

The permitted values of the border thickness is in the range 0 - 72 Points (0 - 1 inch).

Pushing the OK button closes the dialog and causes the image to be redrawn with the new border size.

Pushing the cancel button closes the dialog but leaves the original barcode image unchanged.


Target Size dialog

The target size dialog contains two edit boxes, labelled Height and Width. Values entered into the boxes (in millimetres) are used by dBarcode to determine the most suitable fontsize to use for any text included on the image, and to display the image within the dBarcode window using a suitable aspect ratio.

Values for the image height and width may be entered directly into the edit boxes, or the mini scrollbars may be used to change the existing values.

Note that those barcodes which have a nominal size (eg the EAN-13 and EAN-8 codes) may be placed on the clipboard as metafiles with the correct height and width values by checking the Use Nominal Size checkbox with the Nominal size multiplier set to 100%.  When the Nominal size checkbox is checked the multiplier will initially change to 100% and the nominal size dimensions will appear in the Height and Width boxes. Specifying the nominal size does not prevent the user from changing the aspect ratio by stretching the pasted image within another application.

Barcodes may be scaled to a percentage of the nominal size by entering the required value in the multiplier edit box. Allowed values are 10 - 200%. Note, however, that the acceptable size range for most barcodes types which have nominal sizes is 80-120%.

Users should be aware that some applications do not use (or do not correctly use) the size information within metafiles. So that pasting into such applications will not necessarily produce an image of the correct size.

Pushing the OK button closes the dialog and causes the image to be redrawn using the new parameters.

Pushing the cancel button closes the dialog but leaves the original barcode image unchanged.


File Open dialog

The Open file dialog box allows the user to select a configuration file for opening.

The dialog box shows the list of configuration filenames available in the current directory, using the default extension .BRM. An alternative drive and/or directory may be selected from the listboxes provided, and a suitable filename entered into the edit box.

Pushing the OK button causes the file to be loaded, while pushing the Cancel button cancels the operation and leaves the previous configuration unchanged.


Font selection dialog

The Font selection dialog box allows the user to select the fontname, style (ie. regular, bold or italic) and size of the font which will be used to render the text.  This selection is dependent on the current Windows printer and, in some cases, on the orientation of the page defined for that printer.

The Font selection dialog box contains the following items:

Font listbox	Clicking on a fontname in the Font listbox selects the font for use in rendering the current component; this fontname is copied to the edit box above the list . It also causes the list of available font sizes in the size listbox to be updated. Note that only fonts available for the current printer are included in the Font listbox.

Size listbox	Clicking on a font size in the Size listbox selects the size for use in rendering the current component; this size is copied to the edit box above the list.  For TrueType, PostScript and other continuously scaleable fontsize printers a fixed number of options appear in the size listbox, although any integer point size in the range 4 - 144 points may be entered in the edit box and will be used for printing if the requested value is within the printer's capability.

Style listbox	The font style box shows the font styles available for the currently selected font (including regular, italic, bold, and bold and italic). Clicking on one of these entries will select the style with which the font will be rendered on the screen image.

Sample	The sample box shows a sample of the currently selected font and style.

The Font selection dialog box also contains OK and CANCEL buttons. When OK is selected any changes made within the dialog will be reflected in the Barcode image. If CANCEL is selected any such changes are discarded.


Preferences dialog

The Preferences dialog allows the user to specify a number of the less-commonly required options which effect the barcode image.

The properties accessible are:

1) whether Light Margin Indicators (> and < symbols) are displayed on those EAN codes for which they are recommended; when the Show Margin Indicators checkbox is checked the light margin symbols will be shown on the barcode image. When not checked the light margin indicators are suppressed. The Show Margin Indicators also determines whether the Country Prefix code and the checkdigit are displayed within the light margin for UPC-A and UPC-E codes.

2) whether the checkdigit is included in text displays for those codes for which the display of check digit is optional [Note: the display of check digits is NOT optional for EAN and UPC codes]; when the Show Check Digit checkbox is checked the checkdigit will be shown in the code displayed under the barcode. When not checked the checkdigit is not shown (although it is still present within the barcode).

3) whether the barcode image is created on a transparent background; when the Transparent checkbox is checked the image is created with no background colour. This option should only be checked by users who are confident that the final printed barcode will be placed on a background which does not interfere with the correct scanning of the barcode.

4) a percentage amount (of the font height) by which text may be moved up. This provides a correction for some older applications which do not correctly align text in metafiles; The allowed range is 0-100%.

5) The Line reduction box allows the user to specify a percentage reduction in the thickness of all bars in the barcode image. This is to allow for bar broadening caused by ink flow after printing on different surfaces.

The permitted range of line reduction is 0% to 50%.

The user must ensure that, where line reduction is used, the resulting image after printing is readable with a barcode reader. If the lines are reduced more than is necessary to compensate for ink flow then the bar to space ratio may not be suitable for reading by automatic equipment.

It is important to realise that the line reduction percentage is saved in a style file and so is automatically reinstated when the style is reloaded.

Two additional checkboxes have been added to the Preferences dialog; Extra1 and Extra2. These are not normally used, but they do provide additional functions for specific barcode types. See the Barcodes HELP system for details.


Save dialog

The Save file dialog box, which allows the user to name a file for saving the current configuration or the current metafile image.

The dialog box shows configuartion or metafile files in the current directory, and contains listboxes which permit alternative drives and directories to be selected.

Style (configuration) files are automatically saved with the default extension .BRM unless an alternative extension is explicitly included in the filename, while metafile images are saved with the extension .WMF.