{"action":"created","issue":{"url":"https://api.github.com/repos/danfickle/openhtmltopdf/issues/24","repository_url":"https://api.github.com/repos/danfickle/openhtmltopdf","labels_url":"https://api.github.com/repos/danfickle/openhtmltopdf/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/danfickle/openhtmltopdf/issues/24/comments","events_url":"https://api.github.com/repos/danfickle/openhtmltopdf/issues/24/events","html_url":"https://github.com/danfickle/openhtmltopdf/issues/24","id":150691364,"number":24,"title":"Add support for fillable form elements (basic features)","user":{"login":"ngns","id":18610836,"avatar_url":"https://avatars.githubusercontent.com/u/18610836?v=3","gravatar_id":"","url":"https://api.github.com/users/ngns","html_url":"https://github.com/ngns","followers_url":"https://api.github.com/users/ngns/followers","following_url":"https://api.github.com/users/ngns/following{/other_user}","gists_url":"https://api.github.com/users/ngns/gists{/gist_id}","starred_url":"https://api.github.com/users/ngns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngns/subscriptions","organizations_url":"https://api.github.com/users/ngns/orgs","repos_url":"https://api.github.com/users/ngns/repos","events_url":"https://api.github.com/users/ngns/events{/privacy}","received_events_url":"https://api.github.com/users/ngns/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/danfickle/openhtmltopdf/labels/pdfbox-work-needed","name":"pdfbox-work-needed","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-04-24T19:10:11Z","updated_at":"2016-07-10T10:15:45Z","closed_at":null,"body":"_This issues is extended with \"basic features\", as more advanced features and elements (like drop-downs or definition of text content types) are covered in a separate issue_\r\n\r\nAs in the current flying saucer version, input elements should not only be rendered, but also be created as AcroForm elements in the resulting PDF (note that the implementation in flying saucer has some limitations though - e.g. radioboxes are not yet implemented, and css styles are a bit quirky still). In a first implementation, the following elements should be considered:\r\n\r\n- HTML `<input type=\"text\" name=\"...\" value=\"...\">` : a text form field should be rendered, one line only. If a value is provided in the _value_ attribute, it should be pre-filled with that value. The _name_ attribute should be taken as value for the \"name\" property of the form field.\r\n\r\n- HTML `<textarea name=\"...\" value=\"...\">` : a multi-line text form field should be rendered. The hight of the form field should be created based on the css style. If no \"height\" style can be determined from the css, then it should be calculated based on the _rows_ attribute value, multiplied by the line hight and paddings / line spacings. If the `<textarea>` element has a node child, the form field should be pre-filled with the text content of that child node. The _name_ attribute should be taken as value for the \"name\" property of the form field.\r\n\r\n- HTML `<input type=\"radio\" name=\"...\" value=\"...\" checked=\"true\">` : a radio form field should be rendered. The value from the _id attribute should be taken as group-id for the radio boxes. The \"name\" property of the form field should be composed out of the _name_ attribute, extended by a \".\" and the running number of the element within the group (e.g. if the _name_ is \"mysection.myoptions\" then the form element name of the first radio button with this _name_ will be \"mysection.myoptions.1\"). The \"option\" value of the form element is to be taken directly from the _value_ attribute of the `<input>` element. The option should be selected by default, if the _checked_ attribute in the `<input>` element is set respectively.\r\n\r\n- HTML `<input type=\"checkbox\" name=\"...\" value=\"...\">` : a checkbox form field should be created. The _name_ attribute should be taken as value for the \"name\" property of the form field. The form field value should be taken over from the _value_ property of the `<input>` element. The checkbox should be checked by default, if the _checked_ attribute in the `<input>` element is set respectively.\r\n\r\nFor all the above elements, basic styling for borders (width, color), background-color, inner padding to content and font settings should be applied (for checkboxes and radio buttons, the dot/check sign is rendered in the font-color - so even there it does count)"},"comment":{"url":"https://api.github.com/repos/danfickle/openhtmltopdf/issues/comments/231581293","html_url":"https://github.com/danfickle/openhtmltopdf/issues/24#issuecomment-231581293","issue_url":"https://api.github.com/repos/danfickle/openhtmltopdf/issues/24","id":231581293,"user":{"login":"danfickle","id":1415728,"avatar_url":"https://avatars.githubusercontent.com/u/1415728?v=3","gravatar_id":"","url":"https://api.github.com/users/danfickle","html_url":"https://github.com/danfickle","followers_url":"https://api.github.com/users/danfickle/followers","following_url":"https://api.github.com/users/danfickle/following{/other_user}","gists_url":"https://api.github.com/users/danfickle/gists{/gist_id}","starred_url":"https://api.github.com/users/danfickle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danfickle/subscriptions","organizations_url":"https://api.github.com/users/danfickle/orgs","repos_url":"https://api.github.com/users/danfickle/repos","events_url":"https://api.github.com/users/danfickle/events{/privacy}","received_events_url":"https://api.github.com/users/danfickle/received_events","type":"User","site_admin":false},"created_at":"2016-07-10T10:15:45Z","updated_at":"2016-07-10T10:15:45Z","body":"````html\r\n<html>\r\n<head></head>\r\n<body>\r\n<form method=\"post\" action=\"http://localhost/form.php\">\r\n <div>\r\n <input type=\"checkbox\" name=\"checker\" value=\"1\" checked=\"\" style=\"-fs-checkbox-style: check;\" />\r\n <input type=\"checkbox\" name=\"checker\" value=\"2\" checked=\"\" style=\"-fs-checkbox-style: square;\" />\r\n <input type=\"checkbox\" name=\"checker\" value=\"3\" checked=\"\" style=\"-fs-checkbox-style: diamond;\" />\r\n <input type=\"checkbox\" name=\"checker\" value=\"4\" checked=\"\" style=\"-fs-checkbox-style: star;\" />\r\n <input type=\"checkbox\" name=\"checker\" value=\"5\" checked=\"\" style=\"-fs-checkbox-style: circle;\" />\r\n <input type=\"checkbox\" name=\"checker\" value=\"6\" checked=\"\" style=\"-fs-checkbox-style: cross;\" />\r\n</div>\r\n</form>\r\n</body>\r\n</html>\r\n````\r\nwill now produce:\r\n![checkbox-screenshot](https://cloud.githubusercontent.com/assets/1415728/16712942/62de51a0-46da-11e6-8f52-9b2003113ce0.png)\r\nHowever, due to [PDF-BOX 3298](https://issues.apache.org/jira/browse/PDFBOX-3298) I had to upgrade to PDF-BOX 2.0.3-SNAPSHOT to get checkbox styles working. So we'll have to wait for a PDF-BOX release before releasing ourselves. Custom fonts for text controls are also working with 2.0.3.\r\n\r\nNext up are radio buttons and hidden inputs."}}
{"actor":{"display_login":"danfickle"}}