t-houssian / fillpdf

A python library to make filling pdfs much easier
MIT License
134 stars 23 forks source link

i-9 autofill #20

Open DanielBogden opened 2 years ago

DanielBogden commented 2 years ago

I'm trying to autofill an i-9 right now I'm just using random data. But when I print the fields with fillpdfs.print_form_fields('i-9-paper-version.pdf') I get this

{',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+^$xí\\020\\025X\\006\x9dÜYúAmkÇr>íÖâ=\\002\\010*çÎ6í?L\x96Õ1ò¤\x94ìD\x99\x93\\012\x85Éi\x9d\x92Ø\x93ý\x98\\017Ë¢N&Î2\x87%lk\\000\x9e': ',…·\x00‚å{›“\x0cä«1´:+&„Œ[õ˛„Y¼€ÑqïËÎ\x17', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+\\010øóQ\x80\xad\x80Ï\\0167\\015<bB\x9cÜ"4bbT\x80ê©\x8aî\\037Âõè\\010^\x8b&jÕÙ±r\x92õ\x9d,\\036\\000¦C\\024$tnã+.ï\\016B%éÔ0Õõ': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+Eõ3EÎ¥\x85\x93B\001k\x8aP\022¨¤MöËBY\x9b\x87Ï6x3TëfÏ\x9a\x96âÇxOt÷\x9eý5\030}\x8c\x85âÄ': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+líhç\x9e¼ûlïälI¥öwÀQ\x82\003.\022\x944ø\010ýѮ߯ÁNÕ0¦Z\x8bÓ9¦ÈzJöá\x9a\x89ð$ÑÓËïâºpÆ\x81\025<W\003': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+«P¢\014w\x85\x94ÍÊÈú\x80p\(mãzôUµÉ\033\016ÿ\003\037ò\031]q\013<1\x92Ó\001iþº\x91\x91W¤\002-ê\x9a\016u\007Ü\010su\002*¦=¿¿\015Rßb': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\x99m>6Nlnq\017¤\x9d\x8d¾pTZókÀv©Nº/Ç\x8d¸¹øÖ\024pQÕ`\x9c©\034³l·\034L\x9f\x98&SÐ': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\x99$4æ\x8d\024ÌÀ\x9f\033àÔÎ\037\003WOäÈÞ\036¦bi\017\x91\032Æp\005w\x98#\013\005¼\024K\x9f>ôQõá7-Do': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\x9aÿª¨O\003{WËû\x80¾ JQ ²Ék{©\x9b\010øc«®¿vLÈ\007¶£3z\x83A1\x9b\x8eb\025\001ãSé]': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+·¥ûT¾\x98\023M[AÐ[þÂ}ÎQR}ï\x86\x80\x9f\0215ÆÙ»w\011.¢\x9aoã¹\025MV<ÓìnhX\x8f\xa0ý\002úË.ê\x86\027\001\x81g\x95jlNõÏ': ",…·\x00‚å{›“\x0cä«1´:+$:›þ\x01#Ü\x11‰ÎÀ¹B'¹ƒ", ',\x83·\000\x91å{\x89\x8d\014ä«1´:+1U¢\014\x98\035CÆÃx¡ÙuZp\x8fºQ\x90j{µÎ\032\024ß\x83{\031\017N}¾\011RDN4=\031M%Ú:\\ÐK9\0210»a\022-~\x8cã3üçë~rèÕ{°\x99D\036\020\014FßdËÝl7»': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+:°j6Ît\x7f̨U|Þ\027/s¦\x9bcÑd:1Ý\'KpÂ\x85$ÌJ\x89\015\x8c0Ëþ?·8vx\030»\000\023ÏUÙ°\003\005\x90Iáp\03426\017\x9c\x84J\x83\x7fõ¨\001$Î\x97i"¨\x85ð\(º': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+2=H\x96<\000I;d\x9b\x8bcè$¯©°\x91x\x8eMØ\021\xad\x9cRAt\005\x9d\006\x9aÊ\x86é±¼éd"\x90\003\003ÚÕ\x9cîeØvK\027XG\021¢ù\007GM\x90ùx]\x90\032\001ç\015r\011X\x9c9gíÜÏ': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+8\x8eÄ\x9e\)ãt\000,¢|\x90ÕR\021T\006ÄÀë{\022Æ;f\007\020\037.W\x8d±éÏÎ$\x9c&F\x919VÞãÀÐ\030}ù[ékB\x86\014Ì\000¼L«ù¨â\023': '', ",\x83·\000\x91å{\x89\x8d\014ä«1´:+\x80E\037\000\x88¾®q2²fº7º5í®a=ÍÍ\021:á¿ãL\x8ed{h§¢t>ù=\013q\010\023´,ë´'ÁÒÔ\x90\x9ckà\x8e\x91 ÞñÃ%mlËb": '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\011\001\x81Û\\Ïg\011¿ÿ\001@ý\xa0¶3\021mÎĪm¨ÿ&,úI¨H·\xa0Ó\030\x9fÊ\x90%´JDlüdl\x91<<õ\005Tm/É\021¨¸\002ì\xa0hÂ2\x8f\x810!\'"U\x90ðyÝÃ\x97\022MË': 'Off', ",\x83·\000\x91å{\x89\x8d\014ä«1´:+\x8f\x7fð1 æ\015c\027Á5M6\031ÜÕÁà\x9fz'_r£\034\x81c\\\\^weÖAlu\\003úa«\\031\x91T\\021þMÎLo\x89,ºGîÙ\x85ã²d3?\\004ÄáÀj½åÚ\\0150>Î$V\x9aD\x9e>^\x87p}\\)1¬\x85\x82tø\\023ä+Æ\x86\\013\\007\\011Ôìt¼÷\x9b\\033\x85L\\)ýÌì<": 'Off', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+νF\x9d\\011\xa0ýü\\015a,¡\x9c\x85\\026lÉ÷°\x98ÉÓ\x88¢Í¶3¿\\031ç"%ZXã#<YoÒi\\017E\\(\x90²\\031*0\\020\x99iD\\005-\x8aD\x82X\\007\\033|v\\006P\x81m\\011®C\x9f\\011ÜÒ9\x991Q Q\\036\\011\\011\\032lk÷;#{2\xa0\x9aá1Ây_HAV\x91¯2Ñö\\021\x9b?\x96\x8f:': 'Off', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+Æ|Ã\\022º&VGü}Të¿\\011çù\\007¥\\030i\\005\\026\\\\%z*\\010îáiGB\x8e¨;\x81\x83\\020\x8d\x7f\x8cB\x87Úë;\\020\\016÷\x9f@{1ÝU,\\026eÔþ\\007áñÖtÂ\\001\x99Þè\x87\x81\\002N¸±\x86FËÏ': '', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+\\024È8±\\012\x8c\x98Ü\\015\x82K\x91\\017fB\\006ª¡¸¡\x847Jóû¶©\x97¼sÃËg*Rõ\x81\x9e3v\\024£E6ð³\\000Qɬe\\011\x9b\\003ôl³\\010¨¯\x9fì\\035Uè\\036A\x81\xa0·\x93\x8e¶\x88©|·\x9aM\x8e÷\x81b.¢\x95ÈÉ6\x86úµ\\025\x8cóø¯\\015ÛèlÎ\\024SS,F6ä\\013\\032\x94\x84<{\x93,ßõà¡\\(\\024\\032\x80ÿè¸': 'Off', ",\x83·\\000\x91å{\x89\x8d\\014ä«1´:+Ðdr§-Ü\x8d÷'C*«2£\\004å«S8йªA\\011ps7Õ\\026³\\032Qç\\004ÐC©ú\\013\x8c\x9eâ塼\x8cí\\000\\031É\xadÁ2\x9c1»1!ÏÁÌ\\034ù\\026 ï\\037öê\\034w,å,L\x95\x83N\\000¥": '', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+"µ.{Ù\\034\x89¤¨Õösþ·¯\x9a®ô°ºÂ\\)\\036F\\007·0\x96\x96\\020kæ\x8e¤W»\x979ð9õç\003nàö\036\x82\x81\013\014&BòÞµÖn4«^\033áÃê\004\x91&:6¥\x9cTç²<õód': '', ",\x83·\000\x91å{\x89\x8d\014ä«1´:+i5Ú§;\x8f«§äw\x9f]\x8bø[\003\x7f\x9d£\x8cï\xa0S\x8aíÕªävç Õ´gL\x92Æg\023©{\03459À4\x98luhB\x86l®Áx\011Í«\006¦'": '', ",\x83·\000\x91å{\x89\x8d\014ä«1´:+\x91^æ¯Hã8[«d\x932²¸öø%ä.÷]Køp\000:Ù\x90k\001jÑD\033\x80³·ýbÝÙ\033¤\x8eâÜ¥']\021\x88T$\x94\016°²ÑNÊÎ_¨¶": '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+þ<×:nÇ5û·\x8b\005ª8l\x8dØ\020°¤\014èU\x94Ïhß<YÍJ=G[yh+Å\031\x83¢\)úî\x8dõTU\003\025}Ò\x8d]\x8c@ÌO\021~²Zl³©': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+ÿJYKtºä\026¥\004\x8fRÙDÄKùǸFB+Ý\'Z\x8d\x98øݧýr]ÔA_ÛJP¸ßçͪ~AÆ\x98\x96+£\004>üT\002z[\027g¦\x8d\012ð\x80¶\'\x81FiÆ6oÉ0LoD\025"': 'Off', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+¡Pwx\x99ÇÔgÒº`\x83c%c¬g°Ù³Ñ\007Ö®!Ö^vaõ%ÝÊŲ1!\007¡ò\x80¤\022Û1øf26|Ä\032\022LôÍ\004§ê\\Ú\014,ö«ä8\005VmâL²}S\x93µíOhS÷¸3\x83\004\x96«°x;=bð«ð^r\x8b+ðÔX\031\015\x85½ÿaAìº': 'Off', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\000tõ\037|mçF\x7fdPÝMk\x8a\027ç\x86W\x9cp$\x9bà\x86SR8\x87\020J\007â½F\014üÄ\x8f×hXuµQ\(>>\x84k¯×\025!û\x9eB\000ð\x98ó;â\007': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+O\001Ø\x9eU©\023\007\027\016âí\014¸ìw«+Qé@¶y@?ª=\037\035¸\036Áoån\x898\037lï¹\010r\031\x91Ì\023yÁ\x80ËË\x91ú~ÕÜr\030ý2¡Áñ': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+rMÌÛH\001!C|&4âÊ®ýë\014´¦æ¿\016Í=ú¤ð±Ç\033\030m\x8a\032¯\034Í\x9aàÞyOß\021.\x93áº\005GÇ\x80Ý\xa0\\[NeÀ®\x82\012xé': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+¯:ey\x9f/\x8b!O\x85\032Ä\x85·\x8bWãóX\014â96\x99wèò\x8eb\x87Øü·:¬Û\x99ú\x96\006ãóV\017N¡\003': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+1¦ØÊzz\x9cÊ÷ë°VeCÑpâöÄ&;æS\x88\x87\\K©ý\015\x94ä|\x80×±Á\x96\x91\x87?\x8d\\027zÀ\\015': '', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+C\\020\x8bÖϱ\\031Öw\\007\\024,±If¦\\025¼\x8a%\x98³\x9cS÷¹A²êSùB;¢\x7fÍí\x87Ì\x85ÈSÊaÈ\x95\x94': ',…·\x00‚å{›“\x0cä«1´:+5xóÞÛ\x15†m#,b²ÇÀ¬Ö', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+,¯\007F·\016«\x96b\031ع\035\003\x96°ØøÆ\025\034¬\000,[Ú\x81õ\016qðñ¤\004Æ\013&\x90!\x83o\003"HDwHÛ': ',…·\x00‚å{›“\x0cä«1´:+ˇ\x11yÂ/0£&‚÷¹¾b\x0c:À', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\x8a{\005ÙÞNk\x9dv\x8d#Q·¡\x87^\035õ¦ðfnêÉ´Å¥\000\x98ÛçÏw¤&vÌÄxØk}ÈRX\012Ì.-5¯ìU¯\012Ùï\x82\000\x85hYôÀ': '', ",\x83·\000\x91å{\x89\x8d\014ä«1´:+Ó\x87\004\x98Äb\x7fw'Á¹À^9kWù\017ÿ\x9bÆ9øi&t3\x96~÷>\016K\x81Z´ð>¾pMê\013ªa¼6\017§y1=·ß¥¥\x91Òé\x85¦\011\010\x88": '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+zZa\001\x7fÌXÃ\003×\x99Ò\x98\020\\´\003\x9b\xa0\032P=â\x88\x7fÑR\x91Ï\x97\x8e\015EKà&g\033Àe¢¡~ò÷¬\x96\x9b': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\x98\025Öø·\x9e.\x8e]«ô#¯h\x7f@¶\x90æÒ¢Xå\x97\002¢ä÷RókÀ\x9cíÉV\015\x92è¥+R\x84¢\020\x82\x83\x9bÍ\\024iB1,\\020\x9cØ¢2FY\\037': '', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+/éõ8°\003D\x91\004R\004ctÜØ0\x94s\015±Uh\x84Æ\032ª\x9d¿R#\x98ÂÞ\x8béL\006j\030£\x87ãã]u$Ní\x8dz§\014»3\026.ÿ\x7fä%\x97ô': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\022ó\026uTSÂül@\021²ðS\x83\(¾B®\034\x94ú³\x8f઩y,ÀR¯ë¨\025cNÌAºã\025¨0\015\037³ÞFù->#\024qn©,æ!\x8d®\x8e<': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\034\'¤Îy\x90\x82\x8aá|\x94IûH±Ë\023\x89¨SJ®S\xa0"e6¼¨\011\x84\xadve«q\0110h"\x86ýU\024\001"\025akºa\026¤\xa0C\x8a5m@÷á[¦': '', ",\x83·\000\x91å{\x89\x8d\014ä«1´:+'\x81ë¾\x80>#¯E³ÀȾL Ó\x90¨Ì]5eqÚ¤idñð=\xadC\034\x83Uµ>L\032j\x88£\021µ\011\021sræ\036êî+\016ã~\007$\x93&83Ü": '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+è\000£GI\xadþÔÈ\(\x9aÓ9ÅVé\(`ó¸\x9b\011b\030\x92Ì»\034\x9b\031ËØôfÄ©½\x8dmLÖ@\x8d\033;´É\025%\021ä÷ïÁi5É\004Ó£ü¶o\x8a': '', ",\x83·\000\x91å{\x89\x8d\014ä«1´:+ç¹\011{¿\x98\022\x8feÜú|°]·ÏÞ½<\022²þcÜÈÖò¤'ã\000=\x9b\000\031\026n\x945~\x8c§M\x88YmIÐLÔ\032\x9cñ\x8a·éÔYÓò;sÇ": '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\030>ÝPç´ýÚ\x9c\x8a\036ú\x8a\023¹½è\035\030^\x9a[Øv\x98+\x8aX\x7f\0221ck\033Åf-˽7\x910¬\033S\002»å\x86$¼\030]\xa0\x96-µ×ÚÂÝß&Ê': '', ",\x83·\000\x91å{\x89\x8d\014ä«1´:+¢R7\xa02U'{¦äP?\032Gú©9¸Ò³Aü\x9a\024¾·]M\x9d J0Ì\x97s/\005ª\x9btx\x8f?°ãl\x9e½7rrEo&Ñ\x972\\)\\036^ò·y": '', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+/:Ùu\x84|_Ý\\034g\x85\x9f\x9fm¥a\x85Nü\\012iÑ÷W\\036g\x90}ÑódÄ¡\x81Ùÿ»Ã¼\\001½%¦û©¸\\016\\\\D]\\020\x8c\\033G\x84ÂþùBMTTOm': '', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+\x9c\x8cÖ.ØéÇ»Ü\x95À³DA\\)\x9a0\\034\x99ºZ½\\026ÏL\x87GíA\004\xadÁð\xadG¹\x8aíWÌfq¡\022±Ï\x83\x8d»2öBÝ\003v\016I´K\x84 ¢\x8c\025\027\022þ\x8e7\x9b¼¢sÑÄså+\020': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+vVà\x92W\027Á\x99c\031\005µË\007Åï3±\034\003~å4\027\020Ú\x94co\x91×\)¸\\#j¬[C$ç³Ôï\036\004WG\0076sü¢,T@àj]\024=ÿ05\017Çß\x9fiæ\x92òiö¸ÖuøÅ&': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+ëôËög\x81\022eÌu\007æÓÂFD\036\x85ÌÐñØz©Å\031ý\006\030çµÖ\015èǧ\036¾a/"\x91\x9f\033ä²£¸Ò\012+.Ñ\005\x98I\x9ejWÛ\x93\'?Ù¨sôÆT\035\x98\027NìW\x80\002&\021°': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+ãÒGû\022kkU9\023}{6\033«\x875àRã\x8e&þ\022V\005\x8fP2àù\023ùf®Í\\Ý×ɹ+ºBµ\x81p!Ü\021ç¨f<\037?v~8¾#i¡M': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\x7f#"3Q¸,\x92\x8dõ\035\001ê¨÷é@ll¥XÅ Ó#Ìû\\|\x93ÉCt]´f\031ð>\022YÄO\020À\x8eL9E\002w$ø@Ë{¤\x89\x89k¿ò\006': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\013ò-\x9eÉ@ºúI×\000\001Æ\x957Gü\x86ÿ\011¥\x91´kÉs8\016\x92.zÚpJØxµÛ@\x85ÔjhÃ?M\033\x9f^\025¢mÿªf»í6®"5Rÿ\020': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\017cII´\x85JJL/zºq\004ÃØ\x93m%ÏÚ\x81\xa0C*\x8b\x83D¸àÓq0\x8cEEú\x9a\002\x8aóF>\0157\017\003·À\003RÍ\015Î@YuÒe\030}ßeâðZÂýÐFܤM¹\x8dLØ!Ìc': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\015ë\010h\x98\x8e>\016øê}GÃ\023ðº\016\xa0\)Í\x9f\x8a©kÙjèÕ\x81h470Bò@ßRÛoT2\024¶Á~\x8bu\025\025\x89¬\030HñhcÇ¥¶·\020\012ü': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\001\x88Õls\034ö\x99èÊø\x7fÕ\x9d\x89\025ÿ \027\x81hJì! \x85\002¬\014b\x99mÇÂÝßZµË;N:\x86´\x8b\x8dÛ}¤§ðwkSpeN\x8c\x89¥;Nå\x97': '', ",\x83·\000\x91å{\x89\x8d\014ä«1´:+£\036é\x9b¬\x8e4ê\x94Lb\0004êï]\015A@ºyi¥Î'\011~x²òT¸ Í\x87\x8eÐ\007´\x94\x91üG\034k\0374xµZ%©ª@®7\003eÅ¥\003\000o": '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+R\x9eòÒD\xad\026\x92¢7BUNÝ\x8eÖXªÄÊñ_#7\035w@Xú\004Âi\x7fü\016ó¬\x96\x87Ë#\x9a,àyÈD\x9f\x90ðàoih\023OÎ\025\x88\000\x91òõÚ¦tèU]\032\x81Ú\006«\012B\x88\x9eµ\015': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\014×\030\011|\x92Bm@¦GÅÍæU\013ÒûM\014ü¥\000kûÔ\x96\x9b¨ú"NÏ-5t\030îó\x9c©\x88äße8Ú4\020\x95¯§\x9a\020þ«\032ó~07\x98\x86\006': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\x91ïÃQ:1\x97\x83\013\x97\x7f~D¦\x83Í\x9a\033¿\030¤Þû¤±\010áWþÖd\004ÂE\013Ï\x85\x8f\035\x9e\x99±µ°1{Kq@\x80\034ë\x8bÜüÊ¥§ý\x88\037ÈÆc;\(U\000z\006\x88W\)$Å\x8d\x8a\015v\xa0:÷Ër\005\017Ý4\xad±h´\0328»Û': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+C\x914ø\x9b©Õ}Òz½-L\002\034Æ\)\x98\(ÝI\x8cßÊ\033\035®Ì¿\x89ÂÅ\011Cü\014\x81\0010\016A\x90\x9eÔ0È\022¡\x94Ë:¿×>R\000Y\x9aZ\002\013"P\x82¼Â\x89ób\x95[Ðl\x8dYåMÃJz´OGËó8²Xù÷\x97\x89ÆÍD': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\005\xa0\x89:â®\002ÝÞ£ì\x8ep÷\003á\035Ynð\x9d\024¡\x85[P\x9aÒIFùÕ\x8bzß;\x85\034\x84Up=L1\x94㱿;ýæª*\035@lC@ö·3\x7fEºÁ\x93à\031\x99\x99åRðó\x9b¥¥\x9a\x99o': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\006ïÚ[D8\x9aç"\x90å\x8ezàä!Ã\x8b©y\x9dü\017\016\030\(g4?«<¹¸uë\x86¤nD\024\x86SàÉ{uG©:FÑ\021\x98x0K¿ôëZá·L»\007q\001\014\x8b\x96w£\x9clÐ\x85\010\014\x9e°\032³z\0050È\\毹\x85÷\001%Lú': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+¢\026B\x97eÊeh\x92\\021å=\x89½j\\012Â\x8cJkJIKm+×ÓÎa1/?\\022T½\\002©×uÒý¨¼ä\\004«âÃj\\017\\024Âz¨8ÔÛ6lòGãUS8v°È"R\\017ª\\026<aâ\x9fIwµÓ\\026\x81\\035³â\\007\\023ü\x91ã\\020weo': '', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+6Ó]\\)±\\\\wn¹^È.-K{öj\\032ÁQb\\011¥\\030\x8d@\\007®\035\000vS0·\023\016¨Ü\012Ã1$\024k\x83<\xadMÅÐ$ê.:Jr\x81t«Ê.ºq': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+AÉí\015ª\x8cV\037{ôµ½<\001\x814j¬\x9an\020-Ñç¦vqÂ\012Zq\022m\xadyd\0258\x7f¿]ô«Ý\010\)6÷TÐi¤¸e>5ßð¦\x91\x82ð}': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+\026,VÑBÚð§\x81i\x90Â¥\\016;ÿ_6="ðÚ\x85\\036Å \\0173M\x86\x83z\x85P\\005®&^\x88\\010@löy^U': '', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+Z÷\x8eþ:£/ªFZ\\001C[\\000BEIÉò\x87E«$çM\x84afä\\032\\013®c\x91«þ\\006\\030KK¦:ðâ\\012\x8d^\\026': '', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+\\020ÀQX3XUÉäN\x94Êóê#\x96;Ðqß\\015¼a\\036\\007Ó\x8b¦1ÉÐ\x8c®ÄÐ\x920\\024x+ê~g2µÜên': '', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+X\x8dÔaµ\x94§H \\030Ê!&ñ{\\032Ûùg,ôüÜC\\002ª\x92\\013\\(zO\x91+nî\x9dÈǹ\\001Ò7\x8c·½Yås': '', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+yé\x8a"\x95¨Á/Ð>\x95\\001&¼:ÊiÄNWT\x92ðHF.ÃýÜ¥ò@k\\003ù\\004hÓæ\\035õ¼4Â\\020h\027F\026lWæ\x8d\031\x9a<xÚE\x83ZÈw': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+l" e\x84åÎ&%ùw\x9fÓöbf1Q$\x9c©\x88$8Èù<\x7f\x7f\x89F7BÒÂ}º\015\)NÌ´·1Ù«\x99ÀùWÊíü»ó¬x?¬ ¦!ð\x90©}Ö7\021\011¡¶\032\015¨f ±¡\x8e': '', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+òa\007Ö²´wáÂ>ª=h!põ\037*âÅ\\024\x94ûW\x92A=\\005«vsEøZèÍW\x9dÁ\\037\\003Ee\x94¥¯A\\027#ãÓ88\x93°«Â\\024\x93ð¼R\\021': '', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+!ãÌ#T7\x8fåI\\001BO¸ï\\(\x87©ÚÙ\\(ÒW³\\025©r{\\000.+\x98\x9bJP\x91Y<±PuZ£\x98BG\\013¶aâ\x9e5J\\0302\\(Ú1ãÜ¡|\\036Ç\x89': '', ',\x83·\\000\x91å{\x89\x8d\\014ä«1´:+çüÕàLsx\x82\x84\x8b\x9bqwpÚð\x98×fÞí6\\037Ϥ1[ÿ·ú\\012i*¿1E¿\\030¦Ni%tÈèNU': ',…·\x00‚å{›“\x0cä«1´:+}<ŠŁ \x15¨“lNägÊœ•˙', ',\x83·\000\x91å{\x89\x8d\014ä«1´:+Ó«7© s\\bF\004r×®Þ\x8bY\030%Udȼ0Â%Ä\x94Ô\036h\021ÎA\x89£Q\x9de²\x99C\020î6<²ös\035M]¤1\023LÄ\017aàk¸=\003¼2\x85lëÚQWù\x9eË-Oâ¥FYF\x91ñ_á$üÛ\x9cdm\021.|·Ü': ''}`

If I generate a dict off of these fields and put a random value in I get this Traceback (most recent call last): File "pdf.py", line 14, in <module> fillpdfs.write_fillable_pdf('i-9-paper-version.pdf', 'new.pdf', d, flatten=True) File "/Users/bogden/Library/Python/3.8/lib/python/site-packages/fillpdf/fillpdfs.py", line 256, in write_fillable_pdf options = [pdfrw.objects.pdfstring.PdfString.decode(x[0]) for x in options] File "/Users/bogden/Library/Python/3.8/lib/python/site-packages/fillpdf/fillpdfs.py", line 256, in <listcomp> options = [pdfrw.objects.pdfstring.PdfString.decode(x[0]) for x in options] File "/Users/bogden/Library/Python/3.8/lib/python/site-packages/pdfrw/objects/pdfstring.py", line 431, in to_unicode return raw.decode('pdfdocencoding') File "/Users/bogden/Library/Python/3.8/lib/python/site-packages/pdfrw/objects/pdfstring.py", line 316, in decode return codecs.charmap_decode(input, errors, decoding_map) UnicodeDecodeError: 'charmap' codec can't decode byte 0xad in position 25: character maps to <undefined>

It seems like there's an error decoding. Is there something I'm missing?

t-houssian commented 2 years ago

@DanielBogden Interesting. I'll download an I-9 and look into this.

DanielBogden commented 2 years ago

Tried your module with another non-government pdf, works great! I'm guessing encoding issue or some encryption on the government form.