This tutorial will show you how to create a barcode for any purpose.
Tutorial
Finally the simplistic tutorial that teaches you how to create those barcodes that everyone uses. A really easy effect to get that barcode where you don't need drawing random lines on your canvas
Get the Pencil Tool or the Rectangle Tool and set the color to black, a width of 1 px and draw a line while holding down Shift (to get a straight line) ;
Figure 1: A black straight line
Add noise from the Filter menu: Filter > Noise > Add Noise and set the slider to the maximum (400). In adding the filter from the Filter menu (and not from the Property Inspector) the line is now a bitmap.
Figure 2: Line with Noise Effect
Increase the height of the Bitmap by either using the Free Transform Tool or by inputing the desired height of the barcode in the Property Inspector (PI) panel.
Figure 3: the barcode
Add numbers using the Marquee Tool, select a portion of the barcode as illustrated in Figure 4, and press Delete. Press Ctrl + D to remove the Marqee Tool (the "walking ants"). Add some randomly spaced out numbers in the cleared portion.
Make sure the layer of the Bitmap is selected while using the Marquee Tool
Figure 4: The Marquee Tool
Figure 5:Barcode with numbers
Get creative! Add text instead of numbers, or both. Place the barcode on a sticker and give the sticker a Web 2.0 touch.
The sticker has round corners (17%) and is filled with a gray (#DFDFDF) color. A drop shadow has been applied and the blending mode has been set to multiply.
Figure 6: The barcode on a sticker
Now it is time to add a nice, glossy shine to the barcode. As we need the top half of the button to produce the glass effect, we are going to use the Intersect Tool to punch vector in order to create a new path formed by the area common to rectangle and oval. To do this, start by drawing out an oval with the Ellipse Tool and set its opacity to 35.
Then right-click the rectangle, Edit > clone and lock the second rectangle to avoid to be punched. A padlock icon indicates that the layer is locked.