We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.
My client has a PDF form where you fill out product options then it converts those options into a single text field "Lot Number" then finally a field, "Lot Number Barcode", takes the lot number and converts it to a barcode. For some reason this is not working. I know almost nothing about barcode integration but I am a programmer and just looking for some guidance on this topic.
The "Lot Number Barcode" field uses under properties Calculate->Custom Calculation Script this code. So like I said above it's taking the "Lot Number" field and converting to a string which I believe then the font uses to generate the correct barcode or that is the idea.
event.value = this.getField("Lot No").valueAsString;
I found this post on stackoverflow.com about this topic and it seems like it can be much more involved but I don't understand what he is talking about when he says, "start/stop characters, calculating and including the check digit"...etc:
Here is a link to the actual PDF I was given from the client:
Hey, that was me. It would be helpful if you took some time to read up on how code 128 bar code are constructed. Here's a link that might be helpful: Code 128 Barcode FAQ & Tutorial | IDAutomation
The point is you need to do more than the script you show. It's not necessarily complicated, but you need to at least include the start and stop characters, and calculate the check character.
I appreciate the resource but I still can't find my unique solution or should say path to the solution I need. That page has too many options for too many different solutions many of them you have to pay for. Maybe you could help answer specific questions which would help me narrow this down a little.
1. Yes, one that allows at least editable embedding. I stress this because some do not, which prevents it from being used with a PDF form field.
2/3. I can't recommend a specific font at the moment (don't have access to my normal resources), but you might be able to find a free one, and a paid one for less than that. If I have time later tonight I'll post something more.
4. Unfortunately, it depends on the font, since every one I've dealt with is different enough that you have to tailor the code to how they chose to set up the font.
5. It's not usually a problem unless the field gets small. Using auto should be fine, but it's easy enough to test. Will there be an upper limit on the number of characters it will be encoding?