I don't Imagine its very hard. I think its much harder to read a barcode then to make one. make a list with upca codes.
"0001101", // 0 "0011001", // 1 "0010011", // 2 "0111101", // 3 "0100011", // 4 "0110001", // 5 "0101111", // 6 "0111011", // 7"0110111", // 8 "0001011" // 9 search numbers in your barcode against the numbers in the list, if found iterate through each digit in the list and draw a box representing the digits in the list item. You'll have the add the standard formatting at the beginning or end depending on your needs.