ajaxray / markpdf

Watermark PDF files using image or text
GNU Affero General Public License v3.0
176 stars 35 forks source link

MarkPDF working in terminal but not in Laravel > Process #17

Closed laraben closed 2 years ago

laraben commented 2 years ago

Hi,

hopelly someone can help because this bug is driving me crazy.

Initially everything worked fine until few weeks ago. I have updated markpdf with the latest version.

When i use process, the isSuccessful() returns true, But the file is not modified.

When i use the exact same options as in process but paste this in the terminal. Then the file is modified correctly.

This is driving me nuts because i can't make it to work with process and cant see any error messages.

Hopelly someone has an answer.

laraben commented 2 years ago

found the solution. this is not working (while earlier it was with process):

$options = $pdf . ', ' . $image . ', ' . $output . ', -x 1 -y 1 --opacity=0.8';
$process = new Process(['/usr/local/bin/markpdf', $options]);
$process->run();

after several hours of testing i came up with the solution: $process = new Process(['markpdf', $pdf, $image, $output, '-x 1 -y 1 --opacity=0.8']);