diff --git a/src/Handler/Admin/Test.hs b/src/Handler/Admin/Test.hs index 3563b430c..b5a63b6d8 100644 --- a/src/Handler/Admin/Test.hs +++ b/src/Handler/Admin/Test.hs @@ -304,6 +304,11 @@ getAdminTestPdfR = do case content of Right (Right bs) -> do liftIO $ LBS.writeFile "/tmp/generated.pdf" bs - sendByteStringAsFile "demoPDF.pdf" (LBS.toStrict bs) now + mbEncPdf <- encryptPDF "tomatenmarmelade" bs + case mbEncPdf of + Left err -> sendResponseStatus internalServerError500 $ decodeUtf8 $ LBS.toStrict $ "PDFtk error: \n" <> err + Right encPdf -> do + liftIO $ LBS.writeFile "/tmp/crypted.pdf" encPdf + sendByteStringAsFile "demoPDF.pdf" (LBS.toStrict bs) now Right (Left err) -> sendResponseStatus internalServerError500 $ decodeUtf8 $ LBS.toStrict $ "LaTeX compile error: \n" <> err Left err -> sendResponseStatus internalServerError500 $ "Pandoc error: \n" <> P.renderError err diff --git a/templates/i18n/admin-test/de-de-formal.hamlet b/templates/i18n/admin-test/de-de-formal.hamlet index f381b6189..d89b195e0 100644 --- a/templates/i18n/admin-test/de-de-formal.hamlet +++ b/templates/i18n/admin-test/de-de-formal.hamlet @@ -68,7 +68,11 @@

Erzeugtes PDF herunterladen: - Hier ist ein - - Download-Link - für eine PDF Vorschau. \ No newline at end of file +

+ Hier ist ein + + Download-Link + für eine PDF Vorschau. +

+ Zusätzlich wird dabei im Verzeichnis /tmp + das PDF mit und ohne Passwort gespeichert. \ No newline at end of file diff --git a/templates/i18n/admin-test/en-eu.hamlet b/templates/i18n/admin-test/en-eu.hamlet index c45ee9bb4..adcba9f9b 100644 --- a/templates/i18n/admin-test/en-eu.hamlet +++ b/templates/i18n/admin-test/en-eu.hamlet @@ -69,7 +69,12 @@

Download a generated PDF - Here is a - - Download-Link - for a preview. \ No newline at end of file +

+ Here is a + + Download-Link + for a preview. +

+ Following the link, the pdf will also be saved + to the /tmp directory, once without + and once with password protection. \ No newline at end of file