We have 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;
Here is a link to the actual PDF I was given from the client:
https://ufile.io/ihh87
This is what I have found out on this topic but obviously still missing pieces to the puzzle and hope someone can give me the exact steps needed to get this working in Acrobat Pro.
- I need an embeddable CODE 128 font? I found this font set but costs $159 is there a free version that I could use and have it still work? https://www.idautomation.com/barcode-fonts/code-128/
- Javascript - I need to add custom Javascript code to the Actions properties of the "Lot Number Barcode" text field but I don't know which code needs to be implemented and looking for a resource on this to better explain the process.
- Font height and font size - If I get the previous 2 steps working I still need to be concerned with setting the PDF text field to an exact font size and height otherwise the barcode scanner could error out. Is this true? Currently the PDF text field font size is set to "Auto"
You can try the Libre Code128 font (free) at https://fonts.googleapis.com/css?family=Libre+Barcode+128+Text, and the attached JavaScript code to calculate the checksum.
In order to get a Code 128 barcode to print and scan, a checksum needs to be calculated. This involves calculating a weighted sum of the contents of Lot Number and deriving its remainder of division by 103.