Skip to content

Commit

Permalink
Allow rtf conversion to pdf as it is available in Libre Office
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawel Kordowski committed May 4, 2020
1 parent c93df31 commit 58b013b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/OfficeConverter/OfficeConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private function getAllowedConverter($extension = null)
'Jpg' => ['pdf'],
'Jpeg' => ['pdf'],
'Jfif' => ['pdf'],
'rtf' => ['docx', 'txt']
'rtf' => ['docx', 'txt', 'pdf']
];

if ($extension !== null) {
Expand Down Expand Up @@ -228,10 +228,10 @@ private function exec($cmd, $input = '')
// Cannot use $_SERVER superglobal since that's empty during UnitUnishTestCase
// getenv('HOME') isn't set on Windows and generates a Notice.
if ($this->prefixExecWithExportHome) {
$home = getenv('HOME');
if (!is_writable($home)) {
$cmd = 'export HOME=/tmp && ' . $cmd;
}
$home = getenv('HOME');
if (!is_writable($home)) {
$cmd = 'export HOME=/tmp && ' . $cmd;
}
}
$process = proc_open($cmd, [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes);
fwrite($pipes[0], $input);
Expand Down

0 comments on commit 58b013b

Please sign in to comment.