{"id":80,"date":"2023-03-20T19:23:11","date_gmt":"2023-03-20T23:23:11","guid":{"rendered":"https:\/\/kimsal.com\/blog\/?p=80"},"modified":"2023-03-20T19:23:11","modified_gmt":"2023-03-20T23:23:11","slug":"bad-i9-pdf-form","status":"publish","type":"post","link":"https:\/\/kimsal.com\/blog\/2023\/03\/20\/bad-i9-pdf-form\/","title":{"rendered":"Bad I9 PDF form"},"content":{"rendered":"\n<p>Have been needing to programmatically fill out an I9 PDF, retrieved from gov site.  Should be fairly straightforward, right?<\/p>\n\n\n\n<p>Well&#8230; the field names are&#8230; a mess.<\/p>\n\n\n\n<p>Field names like<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><em>topmostSubform[0].Page1[0].U\\.S\\._Social_Security_Number__Last_4_numbers_[0]<\/em>topmostSubform[0].Page1[0].expiration_date__if_applicable__mm_dd_yyyy[0]\ntopmostSubform[0].Page2[0].Employers_Business_or_Organization_Address_Street_Number_and_Name[0]<\/pre>\n\n\n\n<p>and so on make it pretty&#8230; not straightforward to create a usable key\/value combination to search and replace.<\/p>\n\n\n\n<p>But&#8230; today, I noticed it got better.  Every state address I entered was &#8216;wrong&#8217;.  We had a number of PDFs with &#8216;PR&#8217; in them, when the state supplied is &#8216;SC&#8217;.<\/p>\n\n\n\n<p>Digging further, the internal definition of the &#8216;state&#8217; fields look like this<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>\/TU (Section 1., Select State from the drop down list.)<br>\/Opt [[( ) ( )] [(AL) (AK)] [(AK) (AL)] [(AZ) (AR)] [(AR) (AS)] [(CA) (AZ)] [(CO) (CA)] [(CT) (CO)] [(DE) (CT)] [(FL) (DC)] [(GA) (DE)] [(GU) (FL)] [(HI) (GA)] [(IA) (GU)] [(ID) (HI)] [(IL) (IA)] [(IN) (ID)] [(KS) (IL)] [(KY) (IN)] [(LA) (KS)] [(MA) (KY)] [(MD) (LA)] [(ME) (MA)] [(MI) (MD)] [(MN) (ME)] [(MO) (MI)] [(MP) (MN)] [(MS) (MO)] [(MT) (MP)] [(NC) (MS)] [(ND) (MT)] [(NE) (NC)] [(NH) (ND)] [(NJ) (NE)] [(NM) (NH)] [(NV) (NJ)] [(NY) (NM)] [(OH) (NV)] [(OK) (NY)] [(OR) (OH)] [(PA) (OK)] [(PR) (OR)] [(RI) (PA)] [(SC) (PR)] [(SD) (RI)] [(TN) (SC)] [(TX) (SD)] [(UT) (TN)] [(VA) (TX)] [(VI) (UT)] [(VT) (VA)] [(WA) (VI)] [(WI) (VT)] [(WV) (WA)] [(WY) (WI)] [(CAN) (WV)] [(MEX) (WY)] [(0) (CAN)] [(1) (MEX)]]<\/code><\/pre>\n\n\n\n<p>The &#8216;\/Opt&#8217; defines an option list, and each pairing is a display value and an actual value.<\/p>\n\n\n\n<p>Setting the actual value to &#8216;SC&#8217; &#8211; you can see that &#8216;PR&#8217; is paired with &#8216;SC&#8217;, and we get &#8216;PR&#8217; shown in every state field.<\/p>\n\n\n\n<p>This is simply broken, as far as I can tell, and has been for years (since 2019?)<\/p>\n\n\n\n<p>If someone can point me to how this is supposed to be used&#8230; feel free to email or call me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have been needing to programmatically fill out an I9 PDF, retrieved from gov site. Should be fairly straightforward, right? Well&#8230; the field names are&#8230; a mess. Field names like topmostSubform[0].Page1[0].U\\.S\\._Social_Security_Number__Last_4_numbers_[0]topmostSubform[0].Page1[0].expiration_date__if_applicable__mm_dd_yyyy[0] topmostSubform[0].Page2[0].Employers_Business_or_Organization_Address_Street_Number_and_Name[0] and so on make it pretty&#8230; not straightforward to create a usable key\/value combination to search and replace. But&#8230; today, I noticed it got&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/comments?post=80"}],"version-history":[{"count":0,"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/posts\/80\/revisions"}],"wp:attachment":[{"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/media?parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/categories?post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/tags?post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}