Commit f3ec9c2f authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Corrections Pdf => PdfExporter oubliées

parent 2f69c011
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
@@ -11,9 +11,7 @@ use Zend\View\Renderer\PhpRenderer;
 * Classe utilitaire permettant de fabriquer un document PDF à partir
 * de code HTML.
 *
 * NB: bibliothèque mPDF requise (http://www.mpdf1.com/mpdf/).
 *
 * @author bertrand.gauthier@unicaen.fr
 * @author Unicaen
 */
class PdfExporter implements ExporterInterface
{
@@ -246,21 +244,22 @@ class PdfExporter implements ExporterInterface
     * Génère le document PDF et l'envoie éventuellement au navigateur.
     *
     * @param string|null $filename Nom du document PDF (avec extension)
     * Pdf::DESTINATION_BROWSER :
     * PdfExporter::DESTINATION_BROWSER :
     *  Send the file inline to the browser.
     *  The name given by filename is used when one selects the "Save as" option on the link generating the PDF.
     * Pdf::DESTINATION_BROWSER_FORCE_DL :
     * PdfExporter::DESTINATION_BROWSER_FORCE_DL :
     *  Send to the browser and force a file download with the name given by filename.
     * Pdf::DESTINATION_FILE :
     * PdfExporter::DESTINATION_FILE :
     *  Save to a local file with the name given by filename (may include a path).
     * Pdf::DESTINATION_STRING :
     * PdfExporter::DESTINATION_STRING :
     *  Return the document as a string. filename is ignored.
     *
     * @param string $destination Exemple : Pdf::self
     * @param string $destination Exemple : PdfExporter::self
     * @param string|null $memoryLimit
     * @return string
     * @throws \Mpdf\MpdfException
     */
    public function export(string $filename = null, string $destination = Pdf::DESTINATION_BROWSER, string $memoryLimit = null): string
    public function export(string $filename = null, string $destination = PdfExporter::DESTINATION_BROWSER, string $memoryLimit = null): string
    {
        if (!$filename) {
            throw new LogicException("Aucun nom de fichier spécifié.");
@@ -269,7 +268,7 @@ class PdfExporter implements ExporterInterface
            throw new RuntimeException("La bibliothèque mPDF ne semble pas être présente.");
        }
        if (!extension_loaded('gd')) {
            throw new RuntimeException("L'extension php5-gd requise ne semble pas être installée ou chargée.");
            throw new RuntimeException("L'extension php-gd requise ne semble pas être installée ou chargée.");
        }

        if ($memoryLimit) {