From fce089d2fd31aa78ae56a74f0a3960e1ce3f8d4d Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Fri, 25 Oct 2024 16:25:33 +0200 Subject: [PATCH] [fj-doc-mod-fop] PdfFopTypeHandler now concat PDFA and PDFUA mode in format field if both present (i.e. 'PDF/A-1b_PDF/UA-1') --- .../java/org/fugerit/java/doc/mod/fop/PdfFopTypeHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fj-doc-mod-fop/src/main/java/org/fugerit/java/doc/mod/fop/PdfFopTypeHandler.java b/fj-doc-mod-fop/src/main/java/org/fugerit/java/doc/mod/fop/PdfFopTypeHandler.java index d6ae664c0..7b65da17e 100644 --- a/fj-doc-mod-fop/src/main/java/org/fugerit/java/doc/mod/fop/PdfFopTypeHandler.java +++ b/fj-doc-mod-fop/src/main/java/org/fugerit/java/doc/mod/fop/PdfFopTypeHandler.java @@ -3,6 +3,7 @@ import java.io.*; import java.nio.charset.Charset; import java.util.*; +import java.util.stream.Collectors; import javax.xml.transform.Result; import javax.xml.transform.Transformer; @@ -225,7 +226,7 @@ protected void handleConfigTag(Element config) throws ConfigException { log.info( "pdf a mode -> {} : {}", ATT_PDF_A_MODE, pdfAModConfig ); if ( VALID_PDF_A_MODES.contains( pdfAModConfig ) ) { this.setPdfAMode( pdfAModConfig ); - this.setFormat( StringUtils.concat( "_", pdfAModConfig, pdfUAModConfig ) ); + this.setFormat( StringUtils.concat( "_", Arrays.asList( pdfAModConfig, pdfUAModConfig ).stream().filter( s -> s!=null ).collect(Collectors.toList()) ) ); } else { throw new ConfigException( ATT_PDF_A_MODE+" not valid : "+pdfAModConfig+"( valid modes are : "+VALID_PDF_A_MODES+")" ); }