title: Create US Driver License PDF417 barcode using AAMVA data
body: <p>I am trying to generate US DL barcode.</p>
  <p>I've tried to read the original barcode with barcode parser, convert it to ASCII string, and re-generate a new PDF417 barcode with that string. The result barcode image was different with the original one.</p>
  <p>I've also tried to parse it and many online parsing tools worked well.
  Parsing the real barcode gives such data in AAMVA format.</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;AAMVA&gt;
    &lt;user&gt;
      &lt;last e=&quot;DCS&quot;&gt;Last Name&lt;/last&gt;
      &lt;first e=&quot;DAC&quot;&gt;First Name&lt;/first&gt;
      &lt;middle e=&quot;DAD&quot;&gt;Middle Name&lt;/middle&gt;
      &lt;dob e=&quot;DBB&quot;&gt;YYYY-MM-DD&lt;/dob&gt;
      &lt;eyes e=&quot;DAY&quot;&gt;BRO&lt;/eyes&gt;
      &lt;sex e=&quot;DBC&quot;&gt;M&lt;/sex&gt;
      ...
      &lt;issued e=&quot;DBD&quot;&gt;YYYY-MM-DD&lt;/issued&gt;
      &lt;expires e=&quot;DBA&quot;&gt;YYYY-MM-DD&lt;/expires&gt;
    &lt;/user&gt;
    &lt;head&gt;
      &lt;filetype name=&quot;File Type&quot;&gt;ANSI&lt;/filetype&gt;
      &lt;format name=&quot;Data Format&quot;&gt;11&lt;/format&gt;
      &lt;issuer name=&quot;Issuer Identification Number&quot;&gt;xxxxxx&lt;/issuer&gt;
      ...
    &lt;/subfile&gt;
    &lt;subfile designator=&quot;ZO&quot; offset=&quot;248&quot; length=&quot;65&quot;&gt;
      &lt;element id=&quot;A&quot; name=&quot;Optional field A&quot;&gt;N&lt;/element&gt;
      &lt;element id=&quot;B&quot; name=&quot;Optional field B&quot;&gt;N&lt;/element&gt;
      ...
    &lt;/subfile&gt;
  &lt;/AAMVA&gt;
  </code></pre>
  <p>I need to edit this data and re-generate a valid PDF417 barcode.</p>
  <p>How can I do this with free libraries or tools?</p>