{"action":"created","comment":{"url":"https://api.github.com/repos/ifad/colore/pulls/comments/48619555","id":48619555,"diff_hunk":"@@ -48,19 +44,36 @@ def libreoffice( format: )\n       end\n       raise InvalidMimeTypeInStep.new('(various document formats)', job.mime_type) unless to_suffix\n \n-      conversion_method = conversion_methods[to_suffix] || to_suffix\n-      target_file       = \"#{job.content_file}.#{to_suffix}\"\n-      executioner.execute(\n-        'libreoffice',\n-        '--convert-to', conversion_method,\n-        '--outdir', sandbox_dir,\n-        job.content_file,\n-        '--headless',\n-      )\n+      target_file = \"#{job.content_file}.#{to_suffix}\"\n+\n+      if to_suffix == 'txt'\n+        pdf_file       = \"#{job.content_file}.pdf\"\n+        executioner.execute(\n+          'libreoffice',\n+          '--convert-to', 'pdf',\n+          '--outdir', sandbox_dir,\n+          job.content_file,\n+          '--headless',\n+        )\n+\n+        executioner.execute(\n+          'pdftotext',\n+          pdf_file,\n+          target_file\n+        )\n+      else\n+        executioner.execute(\n+          'libreoffice',\n+          '--convert-to', to_suffix,\n+          '--outdir', sandbox_dir,\n+          job.content_file,\n+          '--headless',\n+        )\n+      end\n \n       raise ConversionFailed.new(executioner.last_messages) if executioner.last_exit_status != 0\n       raise ConversionFailed.new(\"Cannot find converted file (looking for #{File.basename(target_file)})\" ) unless File.exist? target_file\n-      c = File.read(target_file)","path":"lib/heathen/processor_methods/libreoffice.rb","position":53,"original_position":53,"commit_id":"8daa5184220584c4b5a8b6dca1bb3e94c92ca46f","original_commit_id":"8daa5184220584c4b5a8b6dca1bb3e94c92ca46f","user":{"login":"vjt","id":14077,"avatar_url":"https://avatars.githubusercontent.com/u/14077?v=3","gravatar_id":"","url":"https://api.github.com/users/vjt","html_url":"https://github.com/vjt","followers_url":"https://api.github.com/users/vjt/followers","following_url":"https://api.github.com/users/vjt/following{/other_user}","gists_url":"https://api.github.com/users/vjt/gists{/gist_id}","starred_url":"https://api.github.com/users/vjt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjt/subscriptions","organizations_url":"https://api.github.com/users/vjt/orgs","repos_url":"https://api.github.com/users/vjt/repos","events_url":"https://api.github.com/users/vjt/events{/privacy}","received_events_url":"https://api.github.com/users/vjt/received_events","type":"User","site_admin":false},"body":"was this a leftover? if yes, good catch! thanks! :+1: ","created_at":"2015-12-30T17:54:41Z","updated_at":"2015-12-30T17:54:41Z","html_url":"https://github.com/ifad/colore/pull/3#discussion_r48619555","pull_request_url":"https://api.github.com/repos/ifad/colore/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/ifad/colore/pulls/comments/48619555"},"html":{"href":"https://github.com/ifad/colore/pull/3#discussion_r48619555"},"pull_request":{"href":"https://api.github.com/repos/ifad/colore/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/ifad/colore/pulls/3","id":54812577,"html_url":"https://github.com/ifad/colore/pull/3","diff_url":"https://github.com/ifad/colore/pull/3.diff","patch_url":"https://github.com/ifad/colore/pull/3.patch","issue_url":"https://api.github.com/repos/ifad/colore/issues/3","number":3,"state":"open","locked":false,"title":"libreoffice text conversion adn specs fixes","user":{"login":"mojarra","id":1818778,"avatar_url":"https://avatars.githubusercontent.com/u/1818778?v=3","gravatar_id":"","url":"https://api.github.com/users/mojarra","html_url":"https://github.com/mojarra","followers_url":"https://api.github.com/users/mojarra/followers","following_url":"https://api.github.com/users/mojarra/following{/other_user}","gists_url":"https://api.github.com/users/mojarra/gists{/gist_id}","starred_url":"https://api.github.com/users/mojarra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mojarra/subscriptions","organizations_url":"https://api.github.com/users/mojarra/orgs","repos_url":"https://api.github.com/users/mojarra/repos","events_url":"https://api.github.com/users/mojarra/events{/privacy}","received_events_url":"https://api.github.com/users/mojarra/received_events","type":"User","site_admin":false},"body":"please @vjt review when you can","created_at":"2015-12-30T16:44:46Z","updated_at":"2015-12-30T17:54:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"78730082ed0e59a168c8aa56e2503c7efed1727c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ifad/colore/pulls/3/commits","review_comments_url":"https://api.github.com/repos/ifad/colore/pulls/3/comments","review_comment_url":"https://api.github.com/repos/ifad/colore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ifad/colore/issues/3/comments","statuses_url":"https://api.github.com/repos/ifad/colore/statuses/8daa5184220584c4b5a8b6dca1bb3e94c92ca46f","head":{"label":"ifad:develop","ref":"develop","sha":"8daa5184220584c4b5a8b6dca1bb3e94c92ca46f","user":{"login":"ifad","id":142712,"avatar_url":"https://avatars.githubusercontent.com/u/142712?v=3","gravatar_id":"","url":"https://api.github.com/users/ifad","html_url":"https://github.com/ifad","followers_url":"https://api.github.com/users/ifad/followers","following_url":"https://api.github.com/users/ifad/following{/other_user}","gists_url":"https://api.github.com/users/ifad/gists{/gist_id}","starred_url":"https://api.github.com/users/ifad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ifad/subscriptions","organizations_url":"https://api.github.com/users/ifad/orgs","repos_url":"https://api.github.com/users/ifad/repos","events_url":"https://api.github.com/users/ifad/events{/privacy}","received_events_url":"https://api.github.com/users/ifad/received_events","type":"Organization","site_admin":false},"repo":{"id":30067287,"name":"colore","full_name":"ifad/colore","owner":{"login":"ifad","id":142712,"avatar_url":"https://avatars.githubusercontent.com/u/142712?v=3","gravatar_id":"","url":"https://api.github.com/users/ifad","html_url":"https://github.com/ifad","followers_url":"https://api.github.com/users/ifad/followers","following_url":"https://api.github.com/users/ifad/following{/other_user}","gists_url":"https://api.github.com/users/ifad/gists{/gist_id}","starred_url":"https://api.github.com/users/ifad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ifad/subscriptions","organizations_url":"https://api.github.com/users/ifad/orgs","repos_url":"https://api.github.com/users/ifad/repos","events_url":"https://api.github.com/users/ifad/events{/privacy}","received_events_url":"https://api.github.com/users/ifad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ifad/colore","description":"COmmon LOcal REpository","fork":false,"url":"https://api.github.com/repos/ifad/colore","forks_url":"https://api.github.com/repos/ifad/colore/forks","keys_url":"https://api.github.com/repos/ifad/colore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ifad/colore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ifad/colore/teams","hooks_url":"https://api.github.com/repos/ifad/colore/hooks","issue_events_url":"https://api.github.com/repos/ifad/colore/issues/events{/number}","events_url":"https://api.github.com/repos/ifad/colore/events","assignees_url":"https://api.github.com/repos/ifad/colore/assignees{/user}","branches_url":"https://api.github.com/repos/ifad/colore/branches{/branch}","tags_url":"https://api.github.com/repos/ifad/colore/tags","blobs_url":"https://api.github.com/repos/ifad/colore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ifad/colore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ifad/colore/git/refs{/sha}","trees_url":"https://api.github.com/repos/ifad/colore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ifad/colore/statuses/{sha}","languages_url":"https://api.github.com/repos/ifad/colore/languages","stargazers_url":"https://api.github.com/repos/ifad/colore/stargazers","contributors_url":"https://api.github.com/repos/ifad/colore/contributors","subscribers_url":"https://api.github.com/repos/ifad/colore/subscribers","subscription_url":"https://api.github.com/repos/ifad/colore/subscription","commits_url":"https://api.github.com/repos/ifad/colore/commits{/sha}","git_commits_url":"https://api.github.com/repos/ifad/colore/git/commits{/sha}","comments_url":"https://api.github.com/repos/ifad/colore/comments{/number}","issue_comment_url":"https://api.github.com/repos/ifad/colore/issues/comments{/number}","contents_url":"https://api.github.com/repos/ifad/colore/contents/{+path}","compare_url":"https://api.github.com/repos/ifad/colore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ifad/colore/merges","archive_url":"https://api.github.com/repos/ifad/colore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ifad/colore/downloads","issues_url":"https://api.github.com/repos/ifad/colore/issues{/number}","pulls_url":"https://api.github.com/repos/ifad/colore/pulls{/number}","milestones_url":"https://api.github.com/repos/ifad/colore/milestones{/number}","notifications_url":"https://api.github.com/repos/ifad/colore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ifad/colore/labels{/name}","releases_url":"https://api.github.com/repos/ifad/colore/releases{/id}","created_at":"2015-01-30T10:26:31Z","updated_at":"2015-04-22T13:22:17Z","pushed_at":"2015-12-30T16:44:46Z","git_url":"git://github.com/ifad/colore.git","ssh_url":"git@github.com:ifad/colore.git","clone_url":"https://github.com/ifad/colore.git","svn_url":"https://github.com/ifad/colore","homepage":null,"size":342,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"ifad:master","ref":"master","sha":"df3757f9da2675ff41e64da1cb4abe0ee806f421","user":{"login":"ifad","id":142712,"avatar_url":"https://avatars.githubusercontent.com/u/142712?v=3","gravatar_id":"","url":"https://api.github.com/users/ifad","html_url":"https://github.com/ifad","followers_url":"https://api.github.com/users/ifad/followers","following_url":"https://api.github.com/users/ifad/following{/other_user}","gists_url":"https://api.github.com/users/ifad/gists{/gist_id}","starred_url":"https://api.github.com/users/ifad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ifad/subscriptions","organizations_url":"https://api.github.com/users/ifad/orgs","repos_url":"https://api.github.com/users/ifad/repos","events_url":"https://api.github.com/users/ifad/events{/privacy}","received_events_url":"https://api.github.com/users/ifad/received_events","type":"Organization","site_admin":false},"repo":{"id":30067287,"name":"colore","full_name":"ifad/colore","owner":{"login":"ifad","id":142712,"avatar_url":"https://avatars.githubusercontent.com/u/142712?v=3","gravatar_id":"","url":"https://api.github.com/users/ifad","html_url":"https://github.com/ifad","followers_url":"https://api.github.com/users/ifad/followers","following_url":"https://api.github.com/users/ifad/following{/other_user}","gists_url":"https://api.github.com/users/ifad/gists{/gist_id}","starred_url":"https://api.github.com/users/ifad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ifad/subscriptions","organizations_url":"https://api.github.com/users/ifad/orgs","repos_url":"https://api.github.com/users/ifad/repos","events_url":"https://api.github.com/users/ifad/events{/privacy}","received_events_url":"https://api.github.com/users/ifad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ifad/colore","description":"COmmon LOcal REpository","fork":false,"url":"https://api.github.com/repos/ifad/colore","forks_url":"https://api.github.com/repos/ifad/colore/forks","keys_url":"https://api.github.com/repos/ifad/colore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ifad/colore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ifad/colore/teams","hooks_url":"https://api.github.com/repos/ifad/colore/hooks","issue_events_url":"https://api.github.com/repos/ifad/colore/issues/events{/number}","events_url":"https://api.github.com/repos/ifad/colore/events","assignees_url":"https://api.github.com/repos/ifad/colore/assignees{/user}","branches_url":"https://api.github.com/repos/ifad/colore/branches{/branch}","tags_url":"https://api.github.com/repos/ifad/colore/tags","blobs_url":"https://api.github.com/repos/ifad/colore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ifad/colore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ifad/colore/git/refs{/sha}","trees_url":"https://api.github.com/repos/ifad/colore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ifad/colore/statuses/{sha}","languages_url":"https://api.github.com/repos/ifad/colore/languages","stargazers_url":"https://api.github.com/repos/ifad/colore/stargazers","contributors_url":"https://api.github.com/repos/ifad/colore/contributors","subscribers_url":"https://api.github.com/repos/ifad/colore/subscribers","subscription_url":"https://api.github.com/repos/ifad/colore/subscription","commits_url":"https://api.github.com/repos/ifad/colore/commits{/sha}","git_commits_url":"https://api.github.com/repos/ifad/colore/git/commits{/sha}","comments_url":"https://api.github.com/repos/ifad/colore/comments{/number}","issue_comment_url":"https://api.github.com/repos/ifad/colore/issues/comments{/number}","contents_url":"https://api.github.com/repos/ifad/colore/contents/{+path}","compare_url":"https://api.github.com/repos/ifad/colore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ifad/colore/merges","archive_url":"https://api.github.com/repos/ifad/colore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ifad/colore/downloads","issues_url":"https://api.github.com/repos/ifad/colore/issues{/number}","pulls_url":"https://api.github.com/repos/ifad/colore/pulls{/number}","milestones_url":"https://api.github.com/repos/ifad/colore/milestones{/number}","notifications_url":"https://api.github.com/repos/ifad/colore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ifad/colore/labels{/name}","releases_url":"https://api.github.com/repos/ifad/colore/releases{/id}","created_at":"2015-01-30T10:26:31Z","updated_at":"2015-04-22T13:22:17Z","pushed_at":"2015-12-30T16:44:46Z","git_url":"git://github.com/ifad/colore.git","ssh_url":"git@github.com:ifad/colore.git","clone_url":"https://github.com/ifad/colore.git","svn_url":"https://github.com/ifad/colore","homepage":null,"size":342,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ifad/colore/pulls/3"},"html":{"href":"https://github.com/ifad/colore/pull/3"},"issue":{"href":"https://api.github.com/repos/ifad/colore/issues/3"},"comments":{"href":"https://api.github.com/repos/ifad/colore/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/ifad/colore/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/ifad/colore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ifad/colore/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/ifad/colore/statuses/8daa5184220584c4b5a8b6dca1bb3e94c92ca46f"}}}}