diff --git a/element/bgimage/classes/element.php b/element/bgimage/classes/element.php index 2a858fc..e4c40b8 100644 --- a/element/bgimage/classes/element.php +++ b/element/bgimage/classes/element.php @@ -98,7 +98,12 @@ class element extends \customcertelement_image\element { $file->copy_content_to($location); // Set the image to the size of the PDF page. - $pdf->Image($location, 0, 0, $pdf->getPageWidth(), $pdf->getPageHeight()); + $mimetype = $file->get_mimetype(); + if ($mimetype == 'image/svg+xml') { + $pdf->ImageSVG($location, 0, 0, $pdf->getPageWidth(), $pdf->getPageHeight()); + } else { + $pdf->Image($location, 0, 0, $pdf->getPageWidth(), $pdf->getPageHeight()); + } } } diff --git a/element/image/classes/element.php b/element/image/classes/element.php index 5a0eef3..faf3e5b 100644 --- a/element/image/classes/element.php +++ b/element/image/classes/element.php @@ -173,7 +173,13 @@ class element extends \mod_customcert\element { if ($file = $fs->get_file_by_hash($imageinfo->pathnamehash)) { $location = make_request_directory() . '/target'; $file->copy_content_to($location); - $pdf->Image($location, $this->element->posx, $this->element->posy, $imageinfo->width, $imageinfo->height); + + $mimetype = $file->get_mimetype(); + if ($mimetype == 'image/svg+xml') { + $pdf->ImageSVG($location, $this->element->posx, $this->element->posy, $imageinfo->width, $imageinfo->height); + } else { + $pdf->Image($location, $this->element->posx, $this->element->posy, $imageinfo->width, $imageinfo->height); + } } }