richdocuments
richdocuments copied to clipboard
Template creator for PDF files
Small patch used for testing in the frontend, but needs a few more adjustments:
- [ ] Only expose if pdftk library is installed
- [ ] Extend template picker to be able to hide the empty template which does not make sense for PDF files
diff --git a/lib/Listener/RegisterTemplateFileCreatorListener.php b/lib/Listener/RegisterTemplateFileCreatorListener.php
index c538da96d..7f3875270 100644
--- a/lib/Listener/RegisterTemplateFileCreatorListener.php
+++ b/lib/Listener/RegisterTemplateFileCreatorListener.php
@@ -93,5 +93,13 @@ class RegisterTemplateFileCreatorListener implements IEventListener {
$odpType->setRatio(1);
return $odpType;
});
+
+ $templateManager->registerTemplateFileCreator(function () use ($appPath) {
+ $odpType = new TemplateFileCreator('richdocuments', $this->l10n->t('New PDF'), '.pdf');
+ $odpType->addMimetype('application/pdf');
+ $odpType->setIconSvgInline(file_get_contents($appPath . '/img/pdf.svg'));
+ $odpType->setRatio(1);
+ return $odpType;
+ });
}
}