From: Vincent Vanwaelscappel Date: Mon, 16 Feb 2026 18:27:47 +0000 (+0100) Subject: wait #7994 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=5061130b9525163d759f7b1a594122485495839b;p=fluidbook-toolbox.git wait #7994 @2 --- diff --git a/app/Console/Commands/UpdatePDFJSLibrary.php b/app/Console/Commands/UpdatePDFJSLibrary.php index 1a0ac0384..cb1dadf61 100644 --- a/app/Console/Commands/UpdatePDFJSLibrary.php +++ b/app/Console/Commands/UpdatePDFJSLibrary.php @@ -11,7 +11,7 @@ class UpdatePDFJSLibrary extends ToolboxCommand /** @see https://mozilla.github.io/pdf.js/getting_started/#download */ protected $signature = 'updatepdfjs'; - protected const VERSION = '5.4.149'; + protected const VERSION = '5.4.624'; //protected const VERSION = '3.11.174'; protected const JQUERY_VERSION = '3.7.1'; diff --git a/app/Fluidbook/Compiler/PDF.php b/app/Fluidbook/Compiler/PDF.php index 943a1566a..dee94593b 100644 --- a/app/Fluidbook/Compiler/PDF.php +++ b/app/Fluidbook/Compiler/PDF.php @@ -2,6 +2,7 @@ namespace App\Fluidbook\Compiler; +use Cubist\Util\CommandLine; use Cubist\Util\Text; trait PDF @@ -51,6 +52,23 @@ trait PDF } else { $pdf = \App\Fluidbook\PDF::compilePDF($this->getFluidbook(), type: 'onlytexts'); } - $this->vdir->copy($pdf, 'data/texts.pdf'); + + if ($this->fluidbookSettings->pdfToCanvasOutline) { + $outlines = str_replace('.pdf', '.outlines.pdf', $pdf); + if (!file_exists($outlines) || filemtime($outlines) < filemtime($pdf)) { + $gs = new CommandLine('gs'); + $gs->setArg('o', $outlines); + $gs->setManualArg('-dNoOutputFonts'); + $gs->setManualArg('-sDEVICE=pdfwrite'); + $gs->setArg(null, $pdf); + $gs->execute(); + $gs->debug(); + } + $texts = $outlines; + } else { + $texts = $pdf; + } + + $this->vdir->copy($texts, 'data/texts.pdf'); } } diff --git a/app/Models/Traits/PublicationSettings.php b/app/Models/Traits/PublicationSettings.php index 650ff5b7f..ad5072fa6 100644 --- a/app/Models/Traits/PublicationSettings.php +++ b/app/Models/Traits/PublicationSettings.php @@ -445,6 +445,7 @@ trait PublicationSettings 'default' => 0, ]); $this->_addSettingField('pdfToCanvasPDF', FilesOrURL::class, __('PDF pour le rendu PDF to Canvas'), ['when' => ['svgToCanvas' => 2]]); + $this->_addSettingField('pdfToCanvasOutline', Checkbox::class, __('Outline des texts du PDF'), ['when' => ['svgToCanvas' => 2], 'hint' => __('Permet de régler des problèmes de rendu de polices')]); $this->_addSettingField('svgToCanvasUpscale', Number::class, $this->__('Upscale de la fonction svgtocanvas'), [ 'default' => 1, 'when' => ['svgToCanvas' => 1],