From 902f3f748d6a278ffec8f1f752bc62c1062c1a02 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Tue, 6 Oct 2020 14:05:57 +0200 Subject: [PATCH] Rename mergeLayers parameter to pdfA --- .../mapfish/print/attribute/map/GenericMapAttribute.java | 5 +++-- .../org/mapfish/print/processor/map/CreateMapProcessor.java | 4 ++-- .../print/attribute/map/GenericMapAttributeTest.java | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/org/mapfish/print/attribute/map/GenericMapAttribute.java b/core/src/main/java/org/mapfish/print/attribute/map/GenericMapAttribute.java index d59ae2a5a4..e9f9f65e42 100644 --- a/core/src/main/java/org/mapfish/print/attribute/map/GenericMapAttribute.java +++ b/core/src/main/java/org/mapfish/print/attribute/map/GenericMapAttribute.java @@ -386,10 +386,11 @@ public abstract class GenericMapAttributeValues { /** * Whether to merge all layers into one. - * This is great to reduce pdf size but need layers having the same imagebufferscaling. + * This is great to reduce pdf size but needs layers having an imagebufferscaling of 1. * Also see the allowTransparency option of the print config. */ - public Boolean mergeLayers; + @HasDefaultValue + public Boolean pdfA = null; /** * Constructor. diff --git a/core/src/main/java/org/mapfish/print/processor/map/CreateMapProcessor.java b/core/src/main/java/org/mapfish/print/processor/map/CreateMapProcessor.java index 4ac01420d5..7f2abb6b68 100644 --- a/core/src/main/java/org/mapfish/print/processor/map/CreateMapProcessor.java +++ b/core/src/main/java/org/mapfish/print/processor/map/CreateMapProcessor.java @@ -233,8 +233,8 @@ public Output execute(final Input param, final ExecutionContext context) } final MapfishMapContext mapContext = createMapContext(mapValues); boolean allowTransparency = param.template.isAllowTransparency(); - if (mapValues.mergeLayers != null) { - allowTransparency = !mapValues.mergeLayers; + if (mapValues.pdfA != null) { + allowTransparency = !mapValues.pdfA; } final List graphics = createLayerGraphics( param.tempTaskDirectory, diff --git a/core/src/test/java/org/mapfish/print/attribute/map/GenericMapAttributeTest.java b/core/src/test/java/org/mapfish/print/attribute/map/GenericMapAttributeTest.java index 70ae86c04c..e5878ff871 100644 --- a/core/src/test/java/org/mapfish/print/attribute/map/GenericMapAttributeTest.java +++ b/core/src/test/java/org/mapfish/print/attribute/map/GenericMapAttributeTest.java @@ -52,7 +52,7 @@ public void testPrintClientConfig() { assertTrue(json.toString(2), json.has(JSON_CLIENT_INFO)); final JSONObject required = json.getJSONObject(JSON_CLIENT_PARAMS); - assertEquals(required.toString(2), 15, required.length()); + assertEquals(required.toString(2), 16, required.length()); assertElem(required, "requiredElem", "int", null, false); assertElem(required, "pArray", "array", null, false); @@ -65,7 +65,7 @@ public void testPrintClientConfig() { assertElem(required, "useAdjustBounds", "boolean", "null", false); assertElem(required, "longitudeFirst", "boolean", "null", false); assertElem(required, "dpiSensitiveStyle", "boolean", "true", false); - assertElem(required, "mergeLayers", "boolean", "false", false); + assertElem(required, "pdfA", "boolean", "null", false); assertEmbedded(required, false, "embedded"); assertEmbedded(required, true, "optionalEmbedded"); @@ -104,7 +104,7 @@ public void testPrintClientConfigWithDefaults() { JSONObject json = new JSONObject(stringWriter.toString()); final JSONObject required = json.getJSONObject(JSON_CLIENT_PARAMS); - assertEquals(15, required.length()); + assertEquals(16, required.length()); assertElem(required, "rotation", "double", "1", false); JSONObject embeddedDefault = required.getJSONObject("embedded").getJSONObject(JSON_ATTRIBUTE_DEFAULT);