{"action":"created","comment":{"url":"https://api.github.com/repos/unidoc/unidoc/pulls/comments/238018186","pull_request_review_id":180469823,"id":238018186,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODAxODE4Ng==","diff_hunk":"@@ -0,0 +1,481 @@\n+/*\n+ * This file is subject to the terms and conditions defined in\n+ * file 'LICENSE.md', which is part of this source code package.\n+ */\n+\n+package model\n+\n+import (\n+\t\"bytes\"\n+\t\"errors\"\n+\t\"fmt\"\n+\t\"io\"\n+\t\"os\"\n+\t\"strconv\"\n+\t\"strings\"\n+\n+\t\"github.com/unidoc/unidoc/common\"\n+\t\"github.com/unidoc/unidoc/pdf/core\"\n+)\n+\n+// PdfAppender appends a new Pdf content to an existing Pdf document.\n+type PdfAppender struct {\n+\trs       io.ReadSeeker\n+\tparser   *core.PdfParser\n+\troReader *PdfReader\n+\tReader   *PdfReader\n+\tpages    []*PdfPage\n+\tacroForm *PdfAcroForm\n+\n+\txrefs          core.XrefTable\n+\tgreatestObjNum int\n+\n+\tnewObjects   []core.PdfObject\n+\thasNewObject map[core.PdfObject]struct{}\n+}\n+\n+func getPageResources(p *PdfPage) map[core.PdfObjectName]core.PdfObject {\n+\tresources := make(map[core.PdfObjectName]core.PdfObject)\n+\tif p.Resources == nil {\n+\t\treturn resources\n+\t}\n+\tif p.Resources.Font != nil {\n+\t\tif dict, found := core.GetDict(p.Resources.Font); found {\n+\t\t\tfor _, key := range dict.Keys() {\n+\t\t\t\tresources[key] = dict.Get(key)\n+\t\t\t}\n+\t\t}\n+\t}\n+\tif p.Resources.ExtGState != nil {\n+\t\tif dict, found := core.GetDict(p.Resources.ExtGState); found {\n+\t\t\tfor _, key := range dict.Keys() {\n+\t\t\t\tresources[key] = dict.Get(key)\n+\t\t\t}\n+\t\t}\n+\t}\n+\tif p.Resources.XObject != nil {\n+\t\tif dict, found := core.GetDict(p.Resources.XObject); found {\n+\t\t\tfor _, key := range dict.Keys() {\n+\t\t\t\tresources[key] = dict.Get(key)","path":"pdf/model/appender.go","position":59,"original_position":59,"commit_id":"31603e50b1a9cc0b7d1eb65c859a6be009fc8ab2","original_commit_id":"31603e50b1a9cc0b7d1eb65c859a6be009fc8ab2","user":{"login":"a5i","id":130427,"node_id":"MDQ6VXNlcjEzMDQyNw==","avatar_url":"https://avatars0.githubusercontent.com/u/130427?v=4","gravatar_id":"","url":"https://api.github.com/users/a5i","html_url":"https://github.com/a5i","followers_url":"https://api.github.com/users/a5i/followers","following_url":"https://api.github.com/users/a5i/following{/other_user}","gists_url":"https://api.github.com/users/a5i/gists{/gist_id}","starred_url":"https://api.github.com/users/a5i/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a5i/subscriptions","organizations_url":"https://api.github.com/users/a5i/orgs","repos_url":"https://api.github.com/users/a5i/repos","events_url":"https://api.github.com/users/a5i/events{/privacy}","received_events_url":"https://api.github.com/users/a5i/received_events","type":"User","site_admin":false},"body":"The same name will be renamed identically. ","created_at":"2018-11-30T22:10:30Z","updated_at":"2018-11-30T22:10:31Z","html_url":"https://github.com/unidoc/unidoc/pull/253#discussion_r238018186","pull_request_url":"https://api.github.com/repos/unidoc/unidoc/pulls/253","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/unidoc/unidoc/pulls/comments/238018186"},"html":{"href":"https://github.com/unidoc/unidoc/pull/253#discussion_r238018186"},"pull_request":{"href":"https://api.github.com/repos/unidoc/unidoc/pulls/253"}},"in_reply_to_id":235337667},"pull_request":{"url":"https://api.github.com/repos/unidoc/unidoc/pulls/253","id":228665052,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4NjY1MDUy","html_url":"https://github.com/unidoc/unidoc/pull/253","diff_url":"https://github.com/unidoc/unidoc/pull/253.diff","patch_url":"https://github.com/unidoc/unidoc/pull/253.patch","issue_url":"https://api.github.com/repos/unidoc/unidoc/issues/253","number":253,"state":"open","locked":false,"title":"Add PdfAppender","user":{"login":"a5i","id":130427,"node_id":"MDQ6VXNlcjEzMDQyNw==","avatar_url":"https://avatars0.githubusercontent.com/u/130427?v=4","gravatar_id":"","url":"https://api.github.com/users/a5i","html_url":"https://github.com/a5i","followers_url":"https://api.github.com/users/a5i/followers","following_url":"https://api.github.com/users/a5i/following{/other_user}","gists_url":"https://api.github.com/users/a5i/gists{/gist_id}","starred_url":"https://api.github.com/users/a5i/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a5i/subscriptions","organizations_url":"https://api.github.com/users/a5i/orgs","repos_url":"https://api.github.com/users/a5i/repos","events_url":"https://api.github.com/users/a5i/events{/privacy}","received_events_url":"https://api.github.com/users/a5i/received_events","type":"User","site_admin":false},"body":"This is a prototype of PdfAppender.\r\nI added a comment to discuss it to #197.","created_at":"2018-11-06T11:51:16Z","updated_at":"2018-11-30T22:10:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc41d899cfeaa20a6210fbf2b149370a3ba2ee19","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/unidoc/unidoc/pulls/253/commits","review_comments_url":"https://api.github.com/repos/unidoc/unidoc/pulls/253/comments","review_comment_url":"https://api.github.com/repos/unidoc/unidoc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/unidoc/unidoc/issues/253/comments","statuses_url":"https://api.github.com/repos/unidoc/unidoc/statuses/31603e50b1a9cc0b7d1eb65c859a6be009fc8ab2","head":{"label":"a5i:v3-pdf-appender","ref":"v3-pdf-appender","sha":"31603e50b1a9cc0b7d1eb65c859a6be009fc8ab2","user":{"login":"a5i","id":130427,"node_id":"MDQ6VXNlcjEzMDQyNw==","avatar_url":"https://avatars0.githubusercontent.com/u/130427?v=4","gravatar_id":"","url":"https://api.github.com/users/a5i","html_url":"https://github.com/a5i","followers_url":"https://api.github.com/users/a5i/followers","following_url":"https://api.github.com/users/a5i/following{/other_user}","gists_url":"https://api.github.com/users/a5i/gists{/gist_id}","starred_url":"https://api.github.com/users/a5i/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a5i/subscriptions","organizations_url":"https://api.github.com/users/a5i/orgs","repos_url":"https://api.github.com/users/a5i/repos","events_url":"https://api.github.com/users/a5i/events{/privacy}","received_events_url":"https://api.github.com/users/a5i/received_events","type":"User","site_admin":false},"repo":{"id":146808069,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY4MDgwNjk=","name":"unidoc","full_name":"a5i/unidoc","private":false,"owner":{"login":"a5i","id":130427,"node_id":"MDQ6VXNlcjEzMDQyNw==","avatar_url":"https://avatars0.githubusercontent.com/u/130427?v=4","gravatar_id":"","url":"https://api.github.com/users/a5i","html_url":"https://github.com/a5i","followers_url":"https://api.github.com/users/a5i/followers","following_url":"https://api.github.com/users/a5i/following{/other_user}","gists_url":"https://api.github.com/users/a5i/gists{/gist_id}","starred_url":"https://api.github.com/users/a5i/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a5i/subscriptions","organizations_url":"https://api.github.com/users/a5i/orgs","repos_url":"https://api.github.com/users/a5i/repos","events_url":"https://api.github.com/users/a5i/events{/privacy}","received_events_url":"https://api.github.com/users/a5i/received_events","type":"User","site_admin":false},"html_url":"https://github.com/a5i/unidoc","description":"UniDoc is a PDF library for Golang","fork":true,"url":"https://api.github.com/repos/a5i/unidoc","forks_url":"https://api.github.com/repos/a5i/unidoc/forks","keys_url":"https://api.github.com/repos/a5i/unidoc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/a5i/unidoc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/a5i/unidoc/teams","hooks_url":"https://api.github.com/repos/a5i/unidoc/hooks","issue_events_url":"https://api.github.com/repos/a5i/unidoc/issues/events{/number}","events_url":"https://api.github.com/repos/a5i/unidoc/events","assignees_url":"https://api.github.com/repos/a5i/unidoc/assignees{/user}","branches_url":"https://api.github.com/repos/a5i/unidoc/branches{/branch}","tags_url":"https://api.github.com/repos/a5i/unidoc/tags","blobs_url":"https://api.github.com/repos/a5i/unidoc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/a5i/unidoc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/a5i/unidoc/git/refs{/sha}","trees_url":"https://api.github.com/repos/a5i/unidoc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/a5i/unidoc/statuses/{sha}","languages_url":"https://api.github.com/repos/a5i/unidoc/languages","stargazers_url":"https://api.github.com/repos/a5i/unidoc/stargazers","contributors_url":"https://api.github.com/repos/a5i/unidoc/contributors","subscribers_url":"https://api.github.com/repos/a5i/unidoc/subscribers","subscription_url":"https://api.github.com/repos/a5i/unidoc/subscription","commits_url":"https://api.github.com/repos/a5i/unidoc/commits{/sha}","git_commits_url":"https://api.github.com/repos/a5i/unidoc/git/commits{/sha}","comments_url":"https://api.github.com/repos/a5i/unidoc/comments{/number}","issue_comment_url":"https://api.github.com/repos/a5i/unidoc/issues/comments{/number}","contents_url":"https://api.github.com/repos/a5i/unidoc/contents/{+path}","compare_url":"https://api.github.com/repos/a5i/unidoc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/a5i/unidoc/merges","archive_url":"https://api.github.com/repos/a5i/unidoc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/a5i/unidoc/downloads","issues_url":"https://api.github.com/repos/a5i/unidoc/issues{/number}","pulls_url":"https://api.github.com/repos/a5i/unidoc/pulls{/number}","milestones_url":"https://api.github.com/repos/a5i/unidoc/milestones{/number}","notifications_url":"https://api.github.com/repos/a5i/unidoc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/a5i/unidoc/labels{/name}","releases_url":"https://api.github.com/repos/a5i/unidoc/releases{/id}","deployments_url":"https://api.github.com/repos/a5i/unidoc/deployments","created_at":"2018-08-30T21:22:48Z","updated_at":"2018-08-30T21:22:51Z","pushed_at":"2018-11-20T20:59:53Z","git_url":"git://github.com/a5i/unidoc.git","ssh_url":"git@github.com:a5i/unidoc.git","clone_url":"https://github.com/a5i/unidoc.git","svn_url":"https://github.com/a5i/unidoc","homepage":"https://unidoc.io","size":12053,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"unidoc:v3","ref":"v3","sha":"319d40718c5c00111eec499fbe66dbefb12d6e93","user":{"login":"unidoc","id":20077688,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMDc3Njg4","avatar_url":"https://avatars1.githubusercontent.com/u/20077688?v=4","gravatar_id":"","url":"https://api.github.com/users/unidoc","html_url":"https://github.com/unidoc","followers_url":"https://api.github.com/users/unidoc/followers","following_url":"https://api.github.com/users/unidoc/following{/other_user}","gists_url":"https://api.github.com/users/unidoc/gists{/gist_id}","starred_url":"https://api.github.com/users/unidoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unidoc/subscriptions","organizations_url":"https://api.github.com/users/unidoc/orgs","repos_url":"https://api.github.com/users/unidoc/repos","events_url":"https://api.github.com/users/unidoc/events{/privacy}","received_events_url":"https://api.github.com/users/unidoc/received_events","type":"Organization","site_admin":false},"repo":{"id":62952373,"node_id":"MDEwOlJlcG9zaXRvcnk2Mjk1MjM3Mw==","name":"unidoc","full_name":"unidoc/unidoc","private":false,"owner":{"login":"unidoc","id":20077688,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMDc3Njg4","avatar_url":"https://avatars1.githubusercontent.com/u/20077688?v=4","gravatar_id":"","url":"https://api.github.com/users/unidoc","html_url":"https://github.com/unidoc","followers_url":"https://api.github.com/users/unidoc/followers","following_url":"https://api.github.com/users/unidoc/following{/other_user}","gists_url":"https://api.github.com/users/unidoc/gists{/gist_id}","starred_url":"https://api.github.com/users/unidoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unidoc/subscriptions","organizations_url":"https://api.github.com/users/unidoc/orgs","repos_url":"https://api.github.com/users/unidoc/repos","events_url":"https://api.github.com/users/unidoc/events{/privacy}","received_events_url":"https://api.github.com/users/unidoc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/unidoc/unidoc","description":"UniDoc is a PDF library for Golang","fork":false,"url":"https://api.github.com/repos/unidoc/unidoc","forks_url":"https://api.github.com/repos/unidoc/unidoc/forks","keys_url":"https://api.github.com/repos/unidoc/unidoc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unidoc/unidoc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unidoc/unidoc/teams","hooks_url":"https://api.github.com/repos/unidoc/unidoc/hooks","issue_events_url":"https://api.github.com/repos/unidoc/unidoc/issues/events{/number}","events_url":"https://api.github.com/repos/unidoc/unidoc/events","assignees_url":"https://api.github.com/repos/unidoc/unidoc/assignees{/user}","branches_url":"https://api.github.com/repos/unidoc/unidoc/branches{/branch}","tags_url":"https://api.github.com/repos/unidoc/unidoc/tags","blobs_url":"https://api.github.com/repos/unidoc/unidoc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unidoc/unidoc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unidoc/unidoc/git/refs{/sha}","trees_url":"https://api.github.com/repos/unidoc/unidoc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unidoc/unidoc/statuses/{sha}","languages_url":"https://api.github.com/repos/unidoc/unidoc/languages","stargazers_url":"https://api.github.com/repos/unidoc/unidoc/stargazers","contributors_url":"https://api.github.com/repos/unidoc/unidoc/contributors","subscribers_url":"https://api.github.com/repos/unidoc/unidoc/subscribers","subscription_url":"https://api.github.com/repos/unidoc/unidoc/subscription","commits_url":"https://api.github.com/repos/unidoc/unidoc/commits{/sha}","git_commits_url":"https://api.github.com/repos/unidoc/unidoc/git/commits{/sha}","comments_url":"https://api.github.com/repos/unidoc/unidoc/comments{/number}","issue_comment_url":"https://api.github.com/repos/unidoc/unidoc/issues/comments{/number}","contents_url":"https://api.github.com/repos/unidoc/unidoc/contents/{+path}","compare_url":"https://api.github.com/repos/unidoc/unidoc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unidoc/unidoc/merges","archive_url":"https://api.github.com/repos/unidoc/unidoc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unidoc/unidoc/downloads","issues_url":"https://api.github.com/repos/unidoc/unidoc/issues{/number}","pulls_url":"https://api.github.com/repos/unidoc/unidoc/pulls{/number}","milestones_url":"https://api.github.com/repos/unidoc/unidoc/milestones{/number}","notifications_url":"https://api.github.com/repos/unidoc/unidoc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unidoc/unidoc/labels{/name}","releases_url":"https://api.github.com/repos/unidoc/unidoc/releases{/id}","deployments_url":"https://api.github.com/repos/unidoc/unidoc/deployments","created_at":"2016-07-09T14:09:11Z","updated_at":"2018-11-30T13:12:08Z","pushed_at":"2018-11-30T20:18:15Z","git_url":"git://github.com/unidoc/unidoc.git","ssh_url":"git@github.com:unidoc/unidoc.git","clone_url":"https://github.com/unidoc/unidoc.git","svn_url":"https://github.com/unidoc/unidoc","homepage":"https://unidoc.io","size":19954,"stargazers_count":566,"watchers_count":566,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":57,"mirror_url":null,"archived":false,"open_issues_count":55,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":57,"open_issues":55,"watchers":566,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/unidoc/unidoc/pulls/253"},"html":{"href":"https://github.com/unidoc/unidoc/pull/253"},"issue":{"href":"https://api.github.com/repos/unidoc/unidoc/issues/253"},"comments":{"href":"https://api.github.com/repos/unidoc/unidoc/issues/253/comments"},"review_comments":{"href":"https://api.github.com/repos/unidoc/unidoc/pulls/253/comments"},"review_comment":{"href":"https://api.github.com/repos/unidoc/unidoc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/unidoc/unidoc/pulls/253/commits"},"statuses":{"href":"https://api.github.com/repos/unidoc/unidoc/statuses/31603e50b1a9cc0b7d1eb65c859a6be009fc8ab2"}},"author_association":"NONE"}}
{"actor":{"display_login":"a5i"}}