title: Code128 Barcode in Adobe Acrobat Form Text Field
body: <p>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.</p>
  
  <p>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.</p>
  
  <pre><code>event.value = this.getField("Lot No").valueAsString;
  </code></pre>
  
  <p>Here is a link to the actual PDF I was given from the client:<br>
  <a href="https://ufile.io/ihh87" rel="nofollow noreferrer">https://ufile.io/ihh87</a></p>
  
  <p>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.</p>
  
  <ol>
  <li>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?
  <a href="https://www.idautomation.com/barcode-fonts/code-128/" rel="nofollow noreferrer">https://www.idautomation.com/barcode-fonts/code-128/</a></li>
  <li>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.</li>
  <li>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"</li>
  </ol>