{"action":"created","issue":{"url":"https://api.github.com/repos/gettalong/hexapdf/issues/38","repository_url":"https://api.github.com/repos/gettalong/hexapdf","labels_url":"https://api.github.com/repos/gettalong/hexapdf/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/gettalong/hexapdf/issues/38/comments","events_url":"https://api.github.com/repos/gettalong/hexapdf/issues/38/events","html_url":"https://github.com/gettalong/hexapdf/issues/38","id":328690142,"node_id":"MDU6SXNzdWUzMjg2OTAxNDI=","number":38,"title":"How to flatten annotations?","user":{"login":"CodeMonkeySteve","id":7467,"node_id":"MDQ6VXNlcjc0Njc=","avatar_url":"https://avatars2.githubusercontent.com/u/7467?v=4","gravatar_id":"","url":"https://api.github.com/users/CodeMonkeySteve","html_url":"https://github.com/CodeMonkeySteve","followers_url":"https://api.github.com/users/CodeMonkeySteve/followers","following_url":"https://api.github.com/users/CodeMonkeySteve/following{/other_user}","gists_url":"https://api.github.com/users/CodeMonkeySteve/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeMonkeySteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeMonkeySteve/subscriptions","organizations_url":"https://api.github.com/users/CodeMonkeySteve/orgs","repos_url":"https://api.github.com/users/CodeMonkeySteve/repos","events_url":"https://api.github.com/users/CodeMonkeySteve/events{/privacy}","received_events_url":"https://api.github.com/users/CodeMonkeySteve/received_events","type":"User","site_admin":false},"labels":[{"id":128603057,"node_id":"MDU6TGFiZWwxMjg2MDMwNTc=","url":"https://api.github.com/repos/gettalong/hexapdf/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"gettalong","id":4104,"node_id":"MDQ6VXNlcjQxMDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/4104?v=4","gravatar_id":"","url":"https://api.github.com/users/gettalong","html_url":"https://github.com/gettalong","followers_url":"https://api.github.com/users/gettalong/followers","following_url":"https://api.github.com/users/gettalong/following{/other_user}","gists_url":"https://api.github.com/users/gettalong/gists{/gist_id}","starred_url":"https://api.github.com/users/gettalong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gettalong/subscriptions","organizations_url":"https://api.github.com/users/gettalong/orgs","repos_url":"https://api.github.com/users/gettalong/repos","events_url":"https://api.github.com/users/gettalong/events{/privacy}","received_events_url":"https://api.github.com/users/gettalong/received_events","type":"User","site_admin":false},"assignees":[{"login":"gettalong","id":4104,"node_id":"MDQ6VXNlcjQxMDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/4104?v=4","gravatar_id":"","url":"https://api.github.com/users/gettalong","html_url":"https://github.com/gettalong","followers_url":"https://api.github.com/users/gettalong/followers","following_url":"https://api.github.com/users/gettalong/following{/other_user}","gists_url":"https://api.github.com/users/gettalong/gists{/gist_id}","starred_url":"https://api.github.com/users/gettalong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gettalong/subscriptions","organizations_url":"https://api.github.com/users/gettalong/orgs","repos_url":"https://api.github.com/users/gettalong/repos","events_url":"https://api.github.com/users/gettalong/events{/privacy}","received_events_url":"https://api.github.com/users/gettalong/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-06-01T23:41:10Z","updated_at":"2018-06-07T05:28:03Z","closed_at":null,"author_association":"NONE","body":"I'm looking for help with converting an AcroForm PDF to a read-only PDF by \"flattening\" the annotations (specifically, the form fields).  I can get the result I want using print-to-PDF in various PDF reader apps.  By any chance does HexaPDF have any support for such an operation, or will I need to process the PDF file myself?  \r\n\r\nIf I must do the processing myself, can you offer any advice?  Is it just a matter of converting Annotation objects into equivalent text/graphic objects with the same bounding box, font, etc.?  That should be straight-forward for text, but I'm not sure how to handle, e.g., the Appearance dictionary for checkboxes.  \r\n\r\nAny assistance would be greatly appreciated, thanks ...\r\n"},"comment":{"url":"https://api.github.com/repos/gettalong/hexapdf/issues/comments/395297528","html_url":"https://github.com/gettalong/hexapdf/issues/38#issuecomment-395297528","issue_url":"https://api.github.com/repos/gettalong/hexapdf/issues/38","id":395297528,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTI5NzUyOA==","user":{"login":"gettalong","id":4104,"node_id":"MDQ6VXNlcjQxMDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/4104?v=4","gravatar_id":"","url":"https://api.github.com/users/gettalong","html_url":"https://github.com/gettalong","followers_url":"https://api.github.com/users/gettalong/followers","following_url":"https://api.github.com/users/gettalong/following{/other_user}","gists_url":"https://api.github.com/users/gettalong/gists{/gist_id}","starred_url":"https://api.github.com/users/gettalong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gettalong/subscriptions","organizations_url":"https://api.github.com/users/gettalong/orgs","repos_url":"https://api.github.com/users/gettalong/repos","events_url":"https://api.github.com/users/gettalong/events{/privacy}","received_events_url":"https://api.github.com/users/gettalong/received_events","type":"User","site_admin":false},"created_at":"2018-06-07T05:28:03Z","updated_at":"2018-06-07T05:28:03Z","author_association":"OWNER","body":"Generally, there is currently no built-in way to re-use fonts from a PDF in HexaPDF.\r\n\r\nHowever, most of the time the fonts used in form fields are the ones built into the PDF format, or, more correctly, the ones every reader has to understand. These fonts are called the *Standard 14 PDF fonts*. So if one of those are used, there is no problem since you can just determine which one of the standard fonts it is and use it.\r\n\r\nHowever, if the field's font references an embedded font and this font is *not* fully embedded but subset there may be a problem since the parts needed to convert from characters to glyph may be missing (e.g. when HexaPDF embeds a TTF font this conversion map is stripped out to save space because it is not needed anymore).\r\n\r\nAlso not that you need to take the `/DA` and `/AP` keys into account that specify the appearance of the text. And the resources specified on the main `/AcroForm` object.\r\n\r\nSo if you have some control over the PDFs you should try to restrict the fonts used in form fields to one of the standard 14 fonts."}}
{"actor":{"display_login":"gettalong"}}