mirror of
https://github.com/moodle/moodle.git
synced 2025-03-10 10:58:38 +01:00
MDL-42240 assignfeedback_editpdf: improve ghostscript debugging
This commit is contained in:
parent
00ae230f52
commit
9092378ddb
@ -401,11 +401,16 @@ class pdf extends \FPDI {
|
||||
"-dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile=\"$imagefile\" \"$filename\"";
|
||||
|
||||
//$command = escapeshellcmd($command);
|
||||
$result = exec($command);
|
||||
$output = null;
|
||||
$result = exec($command, $output);
|
||||
if (!file_exists($imagefile)) {
|
||||
$fullerror = 'Command:' . ($command) . '<br/>';
|
||||
$fullerror .= 'Result:' . htmlspecialchars($result) . '<br/>';
|
||||
throw new \moodle_exception('errorgenerateimage', 'assignfeedback_pdf', '', $fullerror);
|
||||
$fullerror = '<pre>'.get_string('command', 'assignfeedback_editpdf')."\n";
|
||||
$fullerror .= $command . "\n\n";
|
||||
$fullerror .= get_string('result', 'assignfeedback_editpdf')."\n";
|
||||
$fullerror .= htmlspecialchars($result) . "\n\n";
|
||||
$fullerror .= get_string('output', 'assignfeedback_editpdf')."\n";
|
||||
$fullerror .= htmlspecialchars(implode("\n",$output)) . '</pre>';
|
||||
throw new \moodle_exception('errorgenerateimage', 'assignfeedback_editpdf', '', $fullerror);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,7 @@ $string['clear'] = 'Clear';
|
||||
$string['colourpicker'] = 'Colour Picker';
|
||||
$string['commentcolour'] = 'Comment color';
|
||||
$string['comment'] = 'Comments';
|
||||
$string['command'] = 'Command:';
|
||||
$string['commentcontextmenu'] = 'Comment context menu';
|
||||
$string['couldnotsavepage'] = 'Could not save page {$a}';
|
||||
$string['currentstamp'] = 'Stamp';
|
||||
@ -41,6 +42,7 @@ $string['deletecomment'] = 'Delete comment';
|
||||
$string['deletefeedback'] = 'Delete feedback PDF';
|
||||
$string['downloadablefilename'] = 'feedback.pdf';
|
||||
$string['downloadfeedback'] = 'Download feedback PDF';
|
||||
$string['errorgenerateimage'] = 'Error generating image with ghostscript, debugging info: {$a}';
|
||||
$string['editpdf'] = 'Annotate PDF';
|
||||
$string['editpdf_help'] = 'Annotate students submissions directly in the browser and produce an edited downloadable PDF.';
|
||||
$string['enabled'] = 'Annotate PDF';
|
||||
@ -59,11 +61,13 @@ $string['loadingeditor'] = 'Loading PDF editor';
|
||||
$string['navigatenext'] = 'Next page';
|
||||
$string['navigateprevious'] = 'Previous page';
|
||||
$string['oval'] = 'Oval';
|
||||
$string['output'] = 'Output:';
|
||||
$string['pagexofy'] = 'Page {$a->page} of {$a->total}';
|
||||
$string['pen'] = 'Pen';
|
||||
$string['pluginname'] = 'Annotate PDF';
|
||||
$string['rectangle'] = 'Rectangle';
|
||||
$string['red'] = 'Red';
|
||||
$string['result'] = 'Result:';
|
||||
$string['searchcomments'] = 'Search comments';
|
||||
$string['select'] = 'Select';
|
||||
$string['stamppicker'] = 'Stamp picker';
|
||||
|
Loading…
x
Reference in New Issue
Block a user