Gitlab CSE Unil

Commit 8c6faf7d authored by M. Chardon's avatar M. Chardon
Browse files

correction défaut tampons dans PDF généré

parent 5297f2f8
......@@ -751,10 +751,6 @@ EOD;
// Need to generate the page images - first get a combined pdf.
$document = self::get_combined_pdf_for_attempt($assignment, $userid, $attemptnumber);
/* $file = self::get_combined_pdf_for_attempt($assignment, $userid, $attemptnumber);
if (!$file) {
throw new \moodle_exception('Could not generate combined pdf.');
} */
$status = $document->get_status();
if ($status === combined_document::STATUS_FAILED) {
......@@ -794,13 +790,8 @@ EOD;
for ($i = 0; $i < $pagecount; $i++) {
$pdf->copy_page();
//$comments = page_editor::get_comments($grade->id, $i, false);
$annotations = page_editor::get_annotations($grade->id, $i, false);
/* foreach ($comments as $comment) {
$pdf->add_comment($comment->rawtext, $comment->x, $comment->y, $comment->width, $comment->colour);
} */
foreach ($annotations as $annotation) {
$pdf->add_annotation($annotation, $annotation->path, $stamptmpdir, $compteur);
if ($annotation->textannot && !$annotation->parent_annot) {
......
......@@ -505,12 +505,25 @@ class pdf extends \FPDI {
$h = self::MIN_ANNOTATION_HEIGHT;
}
$this->SetXY($sx, $sy);
$colourcartridge = $toolObject->colors;
if (!$colourcartridge) {
$colourcartridge = $typetool->color;
}
$colourcartridgearray = $this->get_colour_for_pdf($colourcartridge);
$this->SetTextColorArray($colourcartridgearray);
$cartouche = $toolObject->label;
//$this->Cell($w);
//Texte centré dans une cellule 20*10 mm encadrée et retour à la ligne
$this->Cell(strlen($cartouche)*6+4, 10, $cartouche, 1, 1, 'C');
break;
default: // Line.
$this->Line($sx, $sy, $ex, $ey);
break;
}
if ($type == 'stampplus' || $type == 'commentplus' || $type == 'stampcomment' || ($type == 'frame' && !$annotation->parent_annot) || $type == 'verticalline' || $type == 'highlightplus') {
if ($type == 'commentplus' || $type == 'stampcomment' || ($type == 'frame' && !$annotation->parent_annot) || $type == 'verticalline' || $type == 'highlightplus') {
$cartouche = $toolObject->cartridge;
if ($annotation->textannot) {
$cartouche .= ' [' . $annotation_index . ']';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment