{"action":"created","issue":{"url":"https://api.github.com/repos/mikehaertl/php-pdftk/issues/32","labels_url":"https://api.github.com/repos/mikehaertl/php-pdftk/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/mikehaertl/php-pdftk/issues/32/comments","events_url":"https://api.github.com/repos/mikehaertl/php-pdftk/issues/32/events","html_url":"https://github.com/mikehaertl/php-pdftk/issues/32","id":117468355,"number":32,"title":"Problems with Checkboxes","user":{"login":"asteinbr","id":1075297,"avatar_url":"https://avatars.githubusercontent.com/u/1075297?v=3","gravatar_id":"","url":"https://api.github.com/users/asteinbr","html_url":"https://github.com/asteinbr","followers_url":"https://api.github.com/users/asteinbr/followers","following_url":"https://api.github.com/users/asteinbr/following{/other_user}","gists_url":"https://api.github.com/users/asteinbr/gists{/gist_id}","starred_url":"https://api.github.com/users/asteinbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asteinbr/subscriptions","organizations_url":"https://api.github.com/users/asteinbr/orgs","repos_url":"https://api.github.com/users/asteinbr/repos","events_url":"https://api.github.com/users/asteinbr/events{/privacy}","received_events_url":"https://api.github.com/users/asteinbr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-17T22:41:20Z","updated_at":"2015-11-18T07:35:11Z","closed_at":null,"body":"First thank you for your work.\r\n\r\nI discovered a problem in my environment with php-pdftk and checkboxes in a PDF form.\r\nMy code is following:\r\n\r\n    <?php\r\n    echo \"testPdftk.php started...<br>\";\r\n    \r\n    require_once('vendor/autoload.php');\r\n    \r\n    ini_set('display_errors', 1);\r\n    ini_set('display_startup_errors', 1);\r\n    \r\n    use mikehaertl\\pdftk\\Pdf;\r\n    \r\n    $data = array(\r\n        'name' => 'Jürgen čárka čČćĆđĐ мирано',\r\n        'email' => 'test@email.com',\r\n        'checkbox 1' => 'Yes',\r\n        'checkbox 2' => 0,\r\n        'radio 1' => 2,\r\n    );\r\n    \r\n    $pdf = new Pdf('form.pdf', [\r\n        'command' => \"/home/usr1/.toast/armed/bin/pdftk\",\r\n        'useExec' => true\r\n    ]);\r\n    $pdf->fillForm($data);\r\n    $pdf->needAppearances();\r\n    $pdf->saveAs('filled.pdf');\r\n    \r\n    echo \"<br><a href='filled.pdf'>Output</a>\";\r\n\r\nSo, I am using some extracts of your testcase. \r\nThe result is that no checkbox is checked. I also checked your output file 'https://github.com/mikehaertl/php-pdftk/blob/master/tests/files/filledform.pdf' from the testcases, there is the same output, no checkbox checked, but for my understanding the code-line\r\n\r\n    'checkbox 1' => 'Yes'\r\n\r\nshould check the checkbox, which is not checked, though.\r\n\r\nIs this desired or a possible bug?\r\nMy environment is following: PHP 5.6.12 and pdftk 2.02.\r\n\r\nThank you in advance."},"comment":{"url":"https://api.github.com/repos/mikehaertl/php-pdftk/issues/comments/157632019","html_url":"https://github.com/mikehaertl/php-pdftk/issues/32#issuecomment-157632019","issue_url":"https://api.github.com/repos/mikehaertl/php-pdftk/issues/32","id":157632019,"user":{"login":"mikehaertl","id":675062,"avatar_url":"https://avatars.githubusercontent.com/u/675062?v=3","gravatar_id":"","url":"https://api.github.com/users/mikehaertl","html_url":"https://github.com/mikehaertl","followers_url":"https://api.github.com/users/mikehaertl/followers","following_url":"https://api.github.com/users/mikehaertl/following{/other_user}","gists_url":"https://api.github.com/users/mikehaertl/gists{/gist_id}","starred_url":"https://api.github.com/users/mikehaertl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikehaertl/subscriptions","organizations_url":"https://api.github.com/users/mikehaertl/orgs","repos_url":"https://api.github.com/users/mikehaertl/repos","events_url":"https://api.github.com/users/mikehaertl/events{/privacy}","received_events_url":"https://api.github.com/users/mikehaertl/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T07:35:11Z","updated_at":"2015-11-18T07:35:11Z","body":"You need to make sure, that the value you set for the checkbox field in the array is the same as what you defined as option value in the PDF. In Acrobat this is what you see if you open the checkbox properties and go to \"Options -> Export Value\". If you use `pdftk my.pdf dump_data_fields` you should see that value under `FieldStateOption:`."}}