{"action":"created","comment":{"url":"https://api.github.com/repos/spatie/pdf-to-image/pulls/comments/61485382","id":61485382,"diff_hunk":"@@ -125,6 +125,31 @@ public function saveImage($pathToImage)\n     }\n \n     /**\n+     * Save the file as images to the given path.\n+     *\n+     * @param string $storeDirectory\n+     * @param string $file_name     \n+     *\n+     * @return array $files the full path to the newly created images.\n+     */\n+    public function extractAllPagesAsImages($storeDirectory, $file_name)\n+    {\n+        $pages = $this->getNumberOfPages();\n+        $files = [];\n+        for($i =1; $i <= $pages; $i++)\n+        {\n+            $this->setPage($i);\n+            $file_path = \"{$storeDirectory}/page_{$i}_{$file_name}.{$this->outputFormat}\";\n+            $imagick = $this->getImageData($file_path);","path":"src/Pdf.php","position":19,"original_position":19,"commit_id":"43e23042ad333cff79567fa903dfb001a67002bf","original_commit_id":"43e23042ad333cff79567fa903dfb001a67002bf","user":{"login":"freekmurze","id":483853,"avatar_url":"https://avatars.githubusercontent.com/u/483853?v=3","gravatar_id":"","url":"https://api.github.com/users/freekmurze","html_url":"https://github.com/freekmurze","followers_url":"https://api.github.com/users/freekmurze/followers","following_url":"https://api.github.com/users/freekmurze/following{/other_user}","gists_url":"https://api.github.com/users/freekmurze/gists{/gist_id}","starred_url":"https://api.github.com/users/freekmurze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freekmurze/subscriptions","organizations_url":"https://api.github.com/users/freekmurze/orgs","repos_url":"https://api.github.com/users/freekmurze/repos","events_url":"https://api.github.com/users/freekmurze/events{/privacy}","received_events_url":"https://api.github.com/users/freekmurze/received_events","type":"User","site_admin":false},"body":"`$imagick` contains the image data. It's better to call this variable `$imageData` 😄 ","created_at":"2016-04-28T19:08:41Z","updated_at":"2016-04-28T19:08:41Z","html_url":"https://github.com/spatie/pdf-to-image/pull/8#discussion_r61485382","pull_request_url":"https://api.github.com/repos/spatie/pdf-to-image/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/spatie/pdf-to-image/pulls/comments/61485382"},"html":{"href":"https://github.com/spatie/pdf-to-image/pull/8#discussion_r61485382"},"pull_request":{"href":"https://api.github.com/repos/spatie/pdf-to-image/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/spatie/pdf-to-image/pulls/8","id":68273080,"html_url":"https://github.com/spatie/pdf-to-image/pull/8","diff_url":"https://github.com/spatie/pdf-to-image/pull/8.diff","patch_url":"https://github.com/spatie/pdf-to-image/pull/8.patch","issue_url":"https://api.github.com/repos/spatie/pdf-to-image/issues/8","number":8,"state":"open","locked":false,"title":"adding the ability to save more than one image","user":{"login":"linuxjuggler","id":27624,"avatar_url":"https://avatars.githubusercontent.com/u/27624?v=3","gravatar_id":"","url":"https://api.github.com/users/linuxjuggler","html_url":"https://github.com/linuxjuggler","followers_url":"https://api.github.com/users/linuxjuggler/followers","following_url":"https://api.github.com/users/linuxjuggler/following{/other_user}","gists_url":"https://api.github.com/users/linuxjuggler/gists{/gist_id}","starred_url":"https://api.github.com/users/linuxjuggler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linuxjuggler/subscriptions","organizations_url":"https://api.github.com/users/linuxjuggler/orgs","repos_url":"https://api.github.com/users/linuxjuggler/repos","events_url":"https://api.github.com/users/linuxjuggler/events{/privacy}","received_events_url":"https://api.github.com/users/linuxjuggler/received_events","type":"User","site_admin":false},"body":"in the case of a file with multiple pages, this function will extract all the pages as images\r\n\r\nam not sure about the testing cause at the end it will need to save the files somewhere ..","created_at":"2016-04-28T19:03:09Z","updated_at":"2016-04-28T19:08:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cfcfeeae73fcc2fe15b647cfe03fc9cbbe935687","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spatie/pdf-to-image/pulls/8/commits","review_comments_url":"https://api.github.com/repos/spatie/pdf-to-image/pulls/8/comments","review_comment_url":"https://api.github.com/repos/spatie/pdf-to-image/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spatie/pdf-to-image/issues/8/comments","statuses_url":"https://api.github.com/repos/spatie/pdf-to-image/statuses/43e23042ad333cff79567fa903dfb001a67002bf","head":{"label":"linuxjuggler:master","ref":"master","sha":"43e23042ad333cff79567fa903dfb001a67002bf","user":{"login":"linuxjuggler","id":27624,"avatar_url":"https://avatars.githubusercontent.com/u/27624?v=3","gravatar_id":"","url":"https://api.github.com/users/linuxjuggler","html_url":"https://github.com/linuxjuggler","followers_url":"https://api.github.com/users/linuxjuggler/followers","following_url":"https://api.github.com/users/linuxjuggler/following{/other_user}","gists_url":"https://api.github.com/users/linuxjuggler/gists{/gist_id}","starred_url":"https://api.github.com/users/linuxjuggler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linuxjuggler/subscriptions","organizations_url":"https://api.github.com/users/linuxjuggler/orgs","repos_url":"https://api.github.com/users/linuxjuggler/repos","events_url":"https://api.github.com/users/linuxjuggler/events{/privacy}","received_events_url":"https://api.github.com/users/linuxjuggler/received_events","type":"User","site_admin":false},"repo":{"id":57325293,"name":"pdf-to-image","full_name":"linuxjuggler/pdf-to-image","owner":{"login":"linuxjuggler","id":27624,"avatar_url":"https://avatars.githubusercontent.com/u/27624?v=3","gravatar_id":"","url":"https://api.github.com/users/linuxjuggler","html_url":"https://github.com/linuxjuggler","followers_url":"https://api.github.com/users/linuxjuggler/followers","following_url":"https://api.github.com/users/linuxjuggler/following{/other_user}","gists_url":"https://api.github.com/users/linuxjuggler/gists{/gist_id}","starred_url":"https://api.github.com/users/linuxjuggler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linuxjuggler/subscriptions","organizations_url":"https://api.github.com/users/linuxjuggler/orgs","repos_url":"https://api.github.com/users/linuxjuggler/repos","events_url":"https://api.github.com/users/linuxjuggler/events{/privacy}","received_events_url":"https://api.github.com/users/linuxjuggler/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/linuxjuggler/pdf-to-image","description":"Convert a pdf to an image","fork":true,"url":"https://api.github.com/repos/linuxjuggler/pdf-to-image","forks_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/forks","keys_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/teams","hooks_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/hooks","issue_events_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/issues/events{/number}","events_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/events","assignees_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/assignees{/user}","branches_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/branches{/branch}","tags_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/tags","blobs_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/statuses/{sha}","languages_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/languages","stargazers_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/stargazers","contributors_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/contributors","subscribers_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/subscribers","subscription_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/subscription","commits_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/contents/{+path}","compare_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/merges","archive_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/downloads","issues_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/issues{/number}","pulls_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/pulls{/number}","milestones_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/milestones{/number}","notifications_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/labels{/name}","releases_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/releases{/id}","deployments_url":"https://api.github.com/repos/linuxjuggler/pdf-to-image/deployments","created_at":"2016-04-28T18:36:00Z","updated_at":"2016-04-28T18:36:01Z","pushed_at":"2016-04-28T19:02:14Z","git_url":"git://github.com/linuxjuggler/pdf-to-image.git","ssh_url":"git@github.com:linuxjuggler/pdf-to-image.git","clone_url":"https://github.com/linuxjuggler/pdf-to-image.git","svn_url":"https://github.com/linuxjuggler/pdf-to-image","homepage":"https://murze.be/2015/07/convert-a-pdf-to-an-image-using-php/","size":33,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spatie:master","ref":"master","sha":"440ea65545f1dd4ec9efc9ecb9a191ddca32e1bc","user":{"login":"spatie","id":7535935,"avatar_url":"https://avatars.githubusercontent.com/u/7535935?v=3","gravatar_id":"","url":"https://api.github.com/users/spatie","html_url":"https://github.com/spatie","followers_url":"https://api.github.com/users/spatie/followers","following_url":"https://api.github.com/users/spatie/following{/other_user}","gists_url":"https://api.github.com/users/spatie/gists{/gist_id}","starred_url":"https://api.github.com/users/spatie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spatie/subscriptions","organizations_url":"https://api.github.com/users/spatie/orgs","repos_url":"https://api.github.com/users/spatie/repos","events_url":"https://api.github.com/users/spatie/events{/privacy}","received_events_url":"https://api.github.com/users/spatie/received_events","type":"Organization","site_admin":false},"repo":{"id":38419604,"name":"pdf-to-image","full_name":"spatie/pdf-to-image","owner":{"login":"spatie","id":7535935,"avatar_url":"https://avatars.githubusercontent.com/u/7535935?v=3","gravatar_id":"","url":"https://api.github.com/users/spatie","html_url":"https://github.com/spatie","followers_url":"https://api.github.com/users/spatie/followers","following_url":"https://api.github.com/users/spatie/following{/other_user}","gists_url":"https://api.github.com/users/spatie/gists{/gist_id}","starred_url":"https://api.github.com/users/spatie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spatie/subscriptions","organizations_url":"https://api.github.com/users/spatie/orgs","repos_url":"https://api.github.com/users/spatie/repos","events_url":"https://api.github.com/users/spatie/events{/privacy}","received_events_url":"https://api.github.com/users/spatie/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spatie/pdf-to-image","description":"Convert a pdf to an image","fork":false,"url":"https://api.github.com/repos/spatie/pdf-to-image","forks_url":"https://api.github.com/repos/spatie/pdf-to-image/forks","keys_url":"https://api.github.com/repos/spatie/pdf-to-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spatie/pdf-to-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spatie/pdf-to-image/teams","hooks_url":"https://api.github.com/repos/spatie/pdf-to-image/hooks","issue_events_url":"https://api.github.com/repos/spatie/pdf-to-image/issues/events{/number}","events_url":"https://api.github.com/repos/spatie/pdf-to-image/events","assignees_url":"https://api.github.com/repos/spatie/pdf-to-image/assignees{/user}","branches_url":"https://api.github.com/repos/spatie/pdf-to-image/branches{/branch}","tags_url":"https://api.github.com/repos/spatie/pdf-to-image/tags","blobs_url":"https://api.github.com/repos/spatie/pdf-to-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spatie/pdf-to-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spatie/pdf-to-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/spatie/pdf-to-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spatie/pdf-to-image/statuses/{sha}","languages_url":"https://api.github.com/repos/spatie/pdf-to-image/languages","stargazers_url":"https://api.github.com/repos/spatie/pdf-to-image/stargazers","contributors_url":"https://api.github.com/repos/spatie/pdf-to-image/contributors","subscribers_url":"https://api.github.com/repos/spatie/pdf-to-image/subscribers","subscription_url":"https://api.github.com/repos/spatie/pdf-to-image/subscription","commits_url":"https://api.github.com/repos/spatie/pdf-to-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/spatie/pdf-to-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/spatie/pdf-to-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/spatie/pdf-to-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/spatie/pdf-to-image/contents/{+path}","compare_url":"https://api.github.com/repos/spatie/pdf-to-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spatie/pdf-to-image/merges","archive_url":"https://api.github.com/repos/spatie/pdf-to-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spatie/pdf-to-image/downloads","issues_url":"https://api.github.com/repos/spatie/pdf-to-image/issues{/number}","pulls_url":"https://api.github.com/repos/spatie/pdf-to-image/pulls{/number}","milestones_url":"https://api.github.com/repos/spatie/pdf-to-image/milestones{/number}","notifications_url":"https://api.github.com/repos/spatie/pdf-to-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spatie/pdf-to-image/labels{/name}","releases_url":"https://api.github.com/repos/spatie/pdf-to-image/releases{/id}","deployments_url":"https://api.github.com/repos/spatie/pdf-to-image/deployments","created_at":"2015-07-02T08:08:18Z","updated_at":"2016-04-20T17:05:00Z","pushed_at":"2016-04-28T19:03:10Z","git_url":"git://github.com/spatie/pdf-to-image.git","ssh_url":"git@github.com:spatie/pdf-to-image.git","clone_url":"https://github.com/spatie/pdf-to-image.git","svn_url":"https://github.com/spatie/pdf-to-image","homepage":"https://murze.be/2015/07/convert-a-pdf-to-an-image-using-php/","size":35,"stargazers_count":48,"watchers_count":48,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":2,"forks":12,"open_issues":2,"watchers":48,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spatie/pdf-to-image/pulls/8"},"html":{"href":"https://github.com/spatie/pdf-to-image/pull/8"},"issue":{"href":"https://api.github.com/repos/spatie/pdf-to-image/issues/8"},"comments":{"href":"https://api.github.com/repos/spatie/pdf-to-image/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/spatie/pdf-to-image/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/spatie/pdf-to-image/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spatie/pdf-to-image/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/spatie/pdf-to-image/statuses/43e23042ad333cff79567fa903dfb001a67002bf"}}}}