46 $this->certificateRepository = $userCertificateRepository;
54 if (null === $pdfFileNameFactory) {
57 $this->pdfFilenameFactory = $pdfFileNameFactory;
65 public function generate(
int $userCertificateId)
67 $certificate = $this->certificateRepository->fetchCertificate($userCertificateId);
80 $certificate = $this->certificateRepository->fetchActiveCertificate($userId, $objId);
87 $certificate = $this->certificateRepository->fetchActiveCertificateForPresentation($userId, $objId);
91 throw new ilException(sprintf(
'The user_id "%s" does NOT reference a user', $userId));
94 $pdfFileName = $this->pdfFilenameFactory->create(
$certificate);
107 $certificateContent = str_replace(
108 '[BACKGROUND_IMAGE]',
112 $certificateContent = str_replace(
118 $pdf_base64 = $this->rpcHelper->ilFO2PDF(
'RPCTransformationHandler', $certificateContent);
120 return $pdf_base64->scalar;
Class ilPdfGeneratorConstantsTest.
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
__construct(ilUserCertificateRepository $userCertificateRepository, ilLogger $logger, ilCertificateRpcClientFactoryHelper $rpcHelper=null, ilCertificatePdfFileNameFactory $pdfFileNameFactory=null)
generateFileName(int $userId, int $objId)
generateCurrentActiveCertificate(int $userId, int $objId)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Component logger with individual log levels by component id.
generate(int $userCertificateId)
createPDFScalar(ilUserCertificate $certificate)