{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/6172","labels_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6172/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6172/comments","events_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6172/events","html_url":"https://github.com/mozilla/pdf.js/pull/6172","id":92788382,"number":6172,"title":"Basic AcroForms input controls rendering","user":{"login":"xlc","id":1201310,"avatar_url":"https://avatars.githubusercontent.com/u/1201310?v=3","gravatar_id":"","url":"https://api.github.com/users/xlc","html_url":"https://github.com/xlc","followers_url":"https://api.github.com/users/xlc/followers","following_url":"https://api.github.com/users/xlc/following{/other_user}","gists_url":"https://api.github.com/users/xlc/gists{/gist_id}","starred_url":"https://api.github.com/users/xlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xlc/subscriptions","organizations_url":"https://api.github.com/users/xlc/orgs","repos_url":"https://api.github.com/users/xlc/repos","events_url":"https://api.github.com/users/xlc/events{/privacy}","received_events_url":"https://api.github.com/users/xlc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mozilla/pdf.js/labels/1-viewer","name":"1-viewer","color":"DDDDDD"},{"url":"https://api.github.com/repos/mozilla/pdf.js/labels/4-form-acroform","name":"4-form-acroform","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-07-03T04:31:02Z","updated_at":"2015-11-16T21:16:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla/pdf.js/pulls/6172","html_url":"https://github.com/mozilla/pdf.js/pull/6172","diff_url":"https://github.com/mozilla/pdf.js/pull/6172.diff","patch_url":"https://github.com/mozilla/pdf.js/pull/6172.patch"},"body":"There is already an example implementation of AcroForms in the examples folder. This PR aim to do it properly.\r\n\r\nThis feature is disabled by default because existing viewer have no way to save input data. This means user will lost their inputs on close. Therefore a persistence solution is required in order to make fully use of this feature. However, this won't be a problem for my company as we provides cloud annotation service.\r\n\r\nAdd `#enableinteractiveforms=true` to url (development build only) or set `PDFJS.enableInteractiveForms` to `true` to enable this feature. (I am still bit confused about how `Preferences` works, please let me know if I did anything wrong)\r\n\r\nThis PR only provide basic implementation of text input fields. Other types of fields (buttons, choice) will be implemented in later PRs.\r\n\r\nIssues & Questions:\r\n\r\n- Printing: Currently only buttons are rendered in canvas and other form elements are not printed.\r\n  - We need to either:\r\n    - Render the DOMs before printing?\r\n    - Or render all of them in canvas?\r\n- Appearance: Need a way to process appearances and apply them to the DOMs.\r\n- How to handle user input values?\r\n  - One way is not expose any JS API. If you need to listen for value change, just do `$('.annotationLayer .widgetControl').on('change', changeHandler);`\r\n  - Or add some method on `PDFPageView` to read/write/listen values."},"comment":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/comments/157173484","html_url":"https://github.com/mozilla/pdf.js/pull/6172#issuecomment-157173484","issue_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6172","id":157173484,"user":{"login":"xlc","id":1201310,"avatar_url":"https://avatars.githubusercontent.com/u/1201310?v=3","gravatar_id":"","url":"https://api.github.com/users/xlc","html_url":"https://github.com/xlc","followers_url":"https://api.github.com/users/xlc/followers","following_url":"https://api.github.com/users/xlc/following{/other_user}","gists_url":"https://api.github.com/users/xlc/gists{/gist_id}","starred_url":"https://api.github.com/users/xlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xlc/subscriptions","organizations_url":"https://api.github.com/users/xlc/orgs","repos_url":"https://api.github.com/users/xlc/repos","events_url":"https://api.github.com/users/xlc/events{/privacy}","received_events_url":"https://api.github.com/users/xlc/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T21:16:48Z","updated_at":"2015-11-16T21:16:48Z","body":"@fbender How should I splitting this? This PR only implements text fields. I have more controls implemented in my other branch which depends on this. I will PR it when this is merged in."}}