Skip to content

Commit

Permalink
PDF/A disabled for encrypted PDF, #264
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelligent2013 committed Sep 2, 2024
1 parent 1d15c7d commit 08b0ebb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/org/metanorma/fop/PDFGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,12 @@ private void runFOP (fontConfig fontcfg, Source src, File pdf) throws IOExceptio
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
// configure foUserAgent
foUserAgent.setProducer("Ribose Metanorma mn2pdf version " + Util.getAppVersion());
foUserAgent.getRendererOptions().put("pdf-a-mode", PDF_A_MODE);
if (encryptionParams.isEmpty()) {
foUserAgent.getRendererOptions().put("pdf-a-mode", PDF_A_MODE);
} else {
logger.severe("PDF/A doesn't allow encrypted PDFs. PDF will be generated in non-PDF/A mode.");
}

setEncryptionParams(foUserAgent);

//Adding a simple logging listener that writes to stdout and stderr
Expand Down

0 comments on commit 08b0ebb

Please sign in to comment.