{"action":"created","comment":{"url":"https://api.github.com/repos/atom/electron/pulls/comments/32287953","id":32287953,"diff_hunk":"@@ -580,6 +582,12 @@ void WebContents::UnregisterServiceWorker(\n                                    callback);\n }\n \n+void WebContents::PrintToPDF(const base::DictionaryValue& setting,\n+    const PrintToPDFCallback& callback) {","path":"atom/browser/api/atom_api_web_contents.cc","position":21,"original_position":21,"commit_id":"34a3a637b0da6e5d4287aa8e6f4753364157b5ad","original_commit_id":"34a3a637b0da6e5d4287aa8e6f4753364157b5ad","user":{"login":"zcbenz","id":639601,"avatar_url":"https://avatars.githubusercontent.com/u/639601?v=3","gravatar_id":"","url":"https://api.github.com/users/zcbenz","html_url":"https://github.com/zcbenz","followers_url":"https://api.github.com/users/zcbenz/followers","following_url":"https://api.github.com/users/zcbenz/following{/other_user}","gists_url":"https://api.github.com/users/zcbenz/gists{/gist_id}","starred_url":"https://api.github.com/users/zcbenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zcbenz/subscriptions","organizations_url":"https://api.github.com/users/zcbenz/orgs","repos_url":"https://api.github.com/users/zcbenz/repos","events_url":"https://api.github.com/users/zcbenz/events{/privacy}","received_events_url":"https://api.github.com/users/zcbenz/received_events","type":"User","site_admin":true},"body":"Parameters should be aligned here.","created_at":"2015-06-12T03:17:08Z","updated_at":"2015-06-12T03:17:08Z","html_url":"https://github.com/atom/electron/pull/1835#discussion_r32287953","pull_request_url":"https://api.github.com/repos/atom/electron/pulls/1835","_links":{"self":{"href":"https://api.github.com/repos/atom/electron/pulls/comments/32287953"},"html":{"href":"https://github.com/atom/electron/pull/1835#discussion_r32287953"},"pull_request":{"href":"https://api.github.com/repos/atom/electron/pulls/1835"}}},"pull_request":{"url":"https://api.github.com/repos/atom/electron/pulls/1835","id":36599829,"html_url":"https://github.com/atom/electron/pull/1835","diff_url":"https://github.com/atom/electron/pull/1835.diff","patch_url":"https://github.com/atom/electron/pull/1835.patch","issue_url":"https://api.github.com/repos/atom/electron/issues/1835","number":1835,"state":"open","locked":false,"title":"Add `BrowserWindow.printToPDF` API Implementation","user":{"login":"hokein","id":2557445,"avatar_url":"https://avatars.githubusercontent.com/u/2557445?v=3","gravatar_id":"","url":"https://api.github.com/users/hokein","html_url":"https://github.com/hokein","followers_url":"https://api.github.com/users/hokein/followers","following_url":"https://api.github.com/users/hokein/following{/other_user}","gists_url":"https://api.github.com/users/hokein/gists{/gist_id}","starred_url":"https://api.github.com/users/hokein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hokein/subscriptions","organizations_url":"https://api.github.com/users/hokein/orgs","repos_url":"https://api.github.com/users/hokein/repos","events_url":"https://api.github.com/users/hokein/events{/privacy}","received_events_url":"https://api.github.com/users/hokein/received_events","type":"User","site_admin":false},"body":"This PR implements a API allowing user to save the browser window page as PDF in local disk. The API provides Chromium Preview feature in `Electron`. Fixes #1157, #805.\r\n\r\nCurrently, the API definition:\r\n\r\n**WebContents.printToPDF([options], callback)**\r\n\r\n* `options` Object\r\n  * `marginsType` Integer - Specify the type of margins to use\r\n    * 0 - default\r\n    * 1 - none\r\n    * 2 - minimum\r\n  * `shouldPrintBackgrounds` Boolean - Whether to print CSS backgrounds.\r\n  * `shouldPrintSelectionOnly` Boolean - Whether to print selection only.\r\n  * `landscape` Boolean - `true` for landscape, `false` for portrait.\r\n\r\n* `callback` Function - `function(error, buffer) {}`\r\n  * `error` Error\r\n  * `buffer` node:Buffer - Contains the pdf data\r\n   \r\n\r\n## TODO\r\n\r\n  - [x]  Implement on Windows\r\n  - [x]   Implement on OS X\r\n  - [x]   Implement on Linux ","created_at":"2015-06-01T05:27:23Z","updated_at":"2015-06-12T03:17:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c11898f1b1ce0dfe895e36721a9a00cd3fad32e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/atom/electron/pulls/1835/commits","review_comments_url":"https://api.github.com/repos/atom/electron/pulls/1835/comments","review_comment_url":"https://api.github.com/repos/atom/electron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/atom/electron/issues/1835/comments","statuses_url":"https://api.github.com/repos/atom/electron/statuses/34a3a637b0da6e5d4287aa8e6f4753364157b5ad","head":{"label":"hokein:pdf-api","ref":"pdf-api","sha":"34a3a637b0da6e5d4287aa8e6f4753364157b5ad","user":{"login":"hokein","id":2557445,"avatar_url":"https://avatars.githubusercontent.com/u/2557445?v=3","gravatar_id":"","url":"https://api.github.com/users/hokein","html_url":"https://github.com/hokein","followers_url":"https://api.github.com/users/hokein/followers","following_url":"https://api.github.com/users/hokein/following{/other_user}","gists_url":"https://api.github.com/users/hokein/gists{/gist_id}","starred_url":"https://api.github.com/users/hokein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hokein/subscriptions","organizations_url":"https://api.github.com/users/hokein/orgs","repos_url":"https://api.github.com/users/hokein/repos","events_url":"https://api.github.com/users/hokein/events{/privacy}","received_events_url":"https://api.github.com/users/hokein/received_events","type":"User","site_admin":false},"repo":{"id":21982125,"name":"atom-shell","full_name":"hokein/atom-shell","owner":{"login":"hokein","id":2557445,"avatar_url":"https://avatars.githubusercontent.com/u/2557445?v=3","gravatar_id":"","url":"https://api.github.com/users/hokein","html_url":"https://github.com/hokein","followers_url":"https://api.github.com/users/hokein/followers","following_url":"https://api.github.com/users/hokein/following{/other_user}","gists_url":"https://api.github.com/users/hokein/gists{/gist_id}","starred_url":"https://api.github.com/users/hokein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hokein/subscriptions","organizations_url":"https://api.github.com/users/hokein/orgs","repos_url":"https://api.github.com/users/hokein/repos","events_url":"https://api.github.com/users/hokein/events{/privacy}","received_events_url":"https://api.github.com/users/hokein/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hokein/atom-shell","description":"Cross-platform desktop application shell","fork":true,"url":"https://api.github.com/repos/hokein/atom-shell","forks_url":"https://api.github.com/repos/hokein/atom-shell/forks","keys_url":"https://api.github.com/repos/hokein/atom-shell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hokein/atom-shell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hokein/atom-shell/teams","hooks_url":"https://api.github.com/repos/hokein/atom-shell/hooks","issue_events_url":"https://api.github.com/repos/hokein/atom-shell/issues/events{/number}","events_url":"https://api.github.com/repos/hokein/atom-shell/events","assignees_url":"https://api.github.com/repos/hokein/atom-shell/assignees{/user}","branches_url":"https://api.github.com/repos/hokein/atom-shell/branches{/branch}","tags_url":"https://api.github.com/repos/hokein/atom-shell/tags","blobs_url":"https://api.github.com/repos/hokein/atom-shell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hokein/atom-shell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hokein/atom-shell/git/refs{/sha}","trees_url":"https://api.github.com/repos/hokein/atom-shell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hokein/atom-shell/statuses/{sha}","languages_url":"https://api.github.com/repos/hokein/atom-shell/languages","stargazers_url":"https://api.github.com/repos/hokein/atom-shell/stargazers","contributors_url":"https://api.github.com/repos/hokein/atom-shell/contributors","subscribers_url":"https://api.github.com/repos/hokein/atom-shell/subscribers","subscription_url":"https://api.github.com/repos/hokein/atom-shell/subscription","commits_url":"https://api.github.com/repos/hokein/atom-shell/commits{/sha}","git_commits_url":"https://api.github.com/repos/hokein/atom-shell/git/commits{/sha}","comments_url":"https://api.github.com/repos/hokein/atom-shell/comments{/number}","issue_comment_url":"https://api.github.com/repos/hokein/atom-shell/issues/comments{/number}","contents_url":"https://api.github.com/repos/hokein/atom-shell/contents/{+path}","compare_url":"https://api.github.com/repos/hokein/atom-shell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hokein/atom-shell/merges","archive_url":"https://api.github.com/repos/hokein/atom-shell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hokein/atom-shell/downloads","issues_url":"https://api.github.com/repos/hokein/atom-shell/issues{/number}","pulls_url":"https://api.github.com/repos/hokein/atom-shell/pulls{/number}","milestones_url":"https://api.github.com/repos/hokein/atom-shell/milestones{/number}","notifications_url":"https://api.github.com/repos/hokein/atom-shell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hokein/atom-shell/labels{/name}","releases_url":"https://api.github.com/repos/hokein/atom-shell/releases{/id}","created_at":"2014-07-18T13:59:17Z","updated_at":"2015-04-28T09:47:06Z","pushed_at":"2015-06-11T07:54:10Z","git_url":"git://github.com/hokein/atom-shell.git","ssh_url":"git@github.com:hokein/atom-shell.git","clone_url":"https://github.com/hokein/atom-shell.git","svn_url":"https://github.com/hokein/atom-shell","homepage":"","size":8979,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"atom:master","ref":"master","sha":"18fcd6990b204dca7b43b54c2fbb9556a7132954","user":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"name":"electron","full_name":"atom/electron","owner":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atom/electron","description":"Build cross platform desktop apps with web technologies","fork":false,"url":"https://api.github.com/repos/atom/electron","forks_url":"https://api.github.com/repos/atom/electron/forks","keys_url":"https://api.github.com/repos/atom/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atom/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atom/electron/teams","hooks_url":"https://api.github.com/repos/atom/electron/hooks","issue_events_url":"https://api.github.com/repos/atom/electron/issues/events{/number}","events_url":"https://api.github.com/repos/atom/electron/events","assignees_url":"https://api.github.com/repos/atom/electron/assignees{/user}","branches_url":"https://api.github.com/repos/atom/electron/branches{/branch}","tags_url":"https://api.github.com/repos/atom/electron/tags","blobs_url":"https://api.github.com/repos/atom/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atom/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atom/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/atom/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atom/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/atom/electron/languages","stargazers_url":"https://api.github.com/repos/atom/electron/stargazers","contributors_url":"https://api.github.com/repos/atom/electron/contributors","subscribers_url":"https://api.github.com/repos/atom/electron/subscribers","subscription_url":"https://api.github.com/repos/atom/electron/subscription","commits_url":"https://api.github.com/repos/atom/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/atom/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/atom/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/atom/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/atom/electron/contents/{+path}","compare_url":"https://api.github.com/repos/atom/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atom/electron/merges","archive_url":"https://api.github.com/repos/atom/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atom/electron/downloads","issues_url":"https://api.github.com/repos/atom/electron/issues{/number}","pulls_url":"https://api.github.com/repos/atom/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/atom/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/atom/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atom/electron/labels{/name}","releases_url":"https://api.github.com/repos/atom/electron/releases{/id}","created_at":"2013-04-12T01:47:36Z","updated_at":"2015-06-12T03:16:36Z","pushed_at":"2015-06-11T15:36:42Z","git_url":"git://github.com/atom/electron.git","ssh_url":"git@github.com:atom/electron.git","clone_url":"https://github.com/atom/electron.git","svn_url":"https://github.com/atom/electron","homepage":"http://electron.atom.io","size":19902,"stargazers_count":12339,"watchers_count":12339,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":912,"mirror_url":null,"open_issues_count":209,"forks":912,"open_issues":209,"watchers":12339,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/atom/electron/pulls/1835"},"html":{"href":"https://github.com/atom/electron/pull/1835"},"issue":{"href":"https://api.github.com/repos/atom/electron/issues/1835"},"comments":{"href":"https://api.github.com/repos/atom/electron/issues/1835/comments"},"review_comments":{"href":"https://api.github.com/repos/atom/electron/pulls/1835/comments"},"review_comment":{"href":"https://api.github.com/repos/atom/electron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/atom/electron/pulls/1835/commits"},"statuses":{"href":"https://api.github.com/repos/atom/electron/statuses/34a3a637b0da6e5d4287aa8e6f4753364157b5ad"}}}}