Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Group info
Recent pages and files
Quick Guide    

 

Introduction

Using Barcode Writer in Pure PostScript requires a tiny bit of PostScript knowledge, but not much.

If you do not want to get your hands messy playing with PostScript then you should instead use one of the project's frontends which hide much of the details.

First Steps

The best way to get familiar with using the code is to download the barcode_with_sample.ps file from http://www.terryburton.co.uk/barcodewriter/files/postscriptbarcode/ and open this with a text editor.

This file consists of the following sections:

  • a PostScript indicator, beginning %PS
  • a prolog defining some optional PostScript DSC comments, with lines beginning %%
  • a block of ordinary comments, with lines beginning %
  • procedure definitions for the renderers delimited by % --BEGIN RENDERER ...-- and % --END RENDERER ...--
  • a set of procedure definitions for the encoders delimited by % --BEGIN ENCODER ...-- and % --END ENCODER ...--
  • a set of sample barcode invokations delimited by % --BEGIN SAMPLE-- and % --END SAMPLE--

This is one example from the samples:

150 750 moveto (0123456789) (includecheck includetext) interleaved2of5


The meaning of each componant of the invokation is as follows:

150 750 moveto              % defines the position on the canvas for the symbol
(0123456789) % the data field containing the information to encode
(includetext height=0.75) % the options field defining features of the symbol
interleaved2of5 % instruction to plot the symbol on the canvas

The acceptable contents of the data field varies from symbology to symbology as defined in the symbologies reference.

The acceptable contents of the options field is for the most part common accross all of the symbologies as defined in the options reference, however encoder specific options do exist in some cases and the default values of omitted options varies accross symbologies.

Using references mentioned above you should now be able to experiment by carefully amending the sample section of the file.

You will want to view the result of your changes regularly (since bugs are hard to track down once introduced) either by using a software PostScript interpretter alongside a viewer or by sending the file to a PostScript enabled printer.

  • GhostScript is a free PostScript interpretter that is available for both Windows and Linux
  • gsview is a viewer for PostScript files on Windows, which requires that GhostScript be installed
  • gv is a viewer for PostScript files on Linux, which requires that GhostScript be installed
  • Most reasonable laser printers have native support for PostScript
  • CUPS, the Common Unix Printing System, adds PostScript support to most non-capable printers by filtering via GhostScript

To directly print a file to a PostScript enabled printer in Windows use the following command:

PRINT [/D:device] barcode_with_sample.ps

Alternatively for a printer attached to the first parallel port:

COPY /B barcode_with_sample.ps LPT1:


To directly print a file to a PostScript enabled printer in Linux use the following command:

lpr -Pdevice -o raw barcode_with_sample.ps


Once you are comfortable with amending the barcode_with_sample.ps file you may want to simplify the file bearing in mind the following points:

  • You need only include the procedure definitions for the symbologies of the symbols that you are actually intending to create. Examining the contents of the PS files created by the web-based generator at http://www.terryburton.co.uk/barcodewriter/generator/ illustrates this point
  • If you intend to create a system for automatically making documents containing barcodes using BWIPP it is strongly suggested that you use the file barcode.ps from http://www.terryburton.co.uk/barcodewriter/files/postscriptbarcode/ as a template and use the % --BEGIN/END ENCODER...-- and % --BEGIN/END RENDERER-- delimiters to extract the relevant procedure definitions into your documents. This will allow you to simply update your project to the latest version of the BWIPP resource by just replacing your barcode.ps with the latest version.
Version: 
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google