const PAGE_BACKGROUND_COLOR = 48;
const FLUIDBOOK_TOOLBOX_ELEARNING_CONTENT = 49;
const LAYER_MASK = 50;
+ const PDF_FORM = 51;
protected static string|false|null $_linksKey = null;
public $left;
return new PDFPopupLink($id, $init, $compiler);
case static::PDF_INLINE:
return new PDFInlineLink($id, $init, $compiler);
+ case static::PDF_FORM:
+ return new PDFFormPopupLink($id, $init, $compiler);
case static::COPY_TO_CLIPBOARD:
return new CopyToClipboardLink($id, $init, $compiler);
case static::PAGE_BACKGROUND_COLOR:
--- /dev/null
+<?php
+
+namespace Fluidbook\Tools\Links;
+
+use Cubist\Util\Graphics\Image;
+use Cubist\PDF\PDFTools;
+
+class PDFFormPopupLink extends NormalLink {
+ public function getDefaultTooltip() {
+ return 'click to fill the form';
+ }
+
+ /**
+ * @throws \Exception
+ */
+ public function getURL() {
+ $this->compiler->addPDFJS(true);
+ $dim = PDFTools::getDimensions($this->compiler->getWorkingDir() . $this->to);
+ $this->compiler->config->set('pdfLinks.' . $this->uid, ['width' => $dim['size'][0], 'height' => $dim['size'][1], 'totalHeight' => $dim['totalHeight'], 'file' => $this->to, 'interface' => $this->pdfjs]);
+ $this->copyExternalFile($this->to);
+ return '#/pdfform/' . $this->uid;
+ }
+}