19 declare(strict_types=1);
44 $irss = $DIC->resourceStorage();
49 $filesystem = $DIC->filesystem()->web();
53 if (
null === $rpcHelper) {
59 $lng = $DIC->language();
62 if (
null === $pdfFileNameFactory) {
65 $this->pdfFilenameFactory = $pdfFileNameFactory;
71 public function generate(
int $userCertificateId): string
73 $certificate = $this->certificateRepository->fetchCertificate($userCertificateId);
83 $certificate = $this->certificateRepository->fetchActiveCertificate($userId, $objId);
95 $certificate = $this->certificateRepository->fetchActiveCertificateForPresentation($userId, $objId);
99 throw new ilException(sprintf(
'The usr_id "%s" does NOT reference a user', $userId));
102 return $this->pdfFilenameFactory->create($certificate);
110 $background_src =
'';
112 $background_src = $this->irss->consume()->src($background_rid)->getSrc(
true);
114 $certificateContent = str_replace(
115 [
'[BACKGROUND_IMAGE]'],
120 $certificateContent = str_replace(
121 [
'[BACKGROUND_IMAGE]',
'[CLIENT_WEB_DIR]'],
127 $pdf_base64 = $this->rpcHelper->ilFO2PDF(
'RPCTransformationHandler', $certificateContent);
129 return $pdf_base64->scalar;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
generateFileName(int $userId, int $objId)
generateCurrentActiveCertificate(int $userId, int $objId)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ResourceIdentification.
readonly ilCertificateRpcClientFactoryHelper $rpcHelper
__construct(private readonly ilUserCertificateRepository $certificateRepository, private ?IRSS $irss=null, private ?Filesystem $filesystem=null, ?ilCertificateRpcClientFactoryHelper $rpcHelper=null, ?ilCertificatePdfFileNameFactory $pdfFileNameFactory=null, ?ilLanguage $lng=null,)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
readonly ilCertificatePdfFileNameFactory $pdfFilenameFactory
generate(int $userCertificateId)
createPDFScalar(ilUserCertificate $certificate)
getCurrentBackgroundImageUsed()