The trick to understanding bar code generation is to realize that a bar code is just an alternative way of writing characters. Some types of bar code have a limited set of characters they can represent (e.g. UPC is a fixed number (usually 13) of characters in the range 0-9)., others such as Code 3 of 9 have a wider range of characters (e.g. Code 3 of 9 is alpha numeric).
So the easiest way to generate bar codes is to use of one of the free Code 3 of 9 fonts, and use that to generate your bar code. You can either use the font in conjunction with the GD library to generate an image, or if you want to generate a PDF containing a bar code just incorporate the characters written in the bar code font directly into the PDF. You may even be able to get a bar code font from one of the web font services such as TypeKit or Google Web Fonts, and just put the bar code directly into the HTML page.
For reading back the bar codes, there's nothing in a normal web browser which will read a bar code and return just the characters. The user of your web app will need to upload an image containing the bar code which you can process on the server. The links that Miqdad Ali posted in his answer might help you do it server side.