From af298c8060a59d05c954ffa5d367b7aace9f05a6 Mon Sep 17 00:00:00 2001 From: Joern Muehlencord Date: Sun, 15 Sep 2019 13:37:30 +0200 Subject: [PATCH] removed pdf library --- pdf/pom.xml | 66 ----- .../de/muehlencord/shared/pdf/CellValue.java | 29 -- .../shared/pdf/ColumnDefinition.java | 40 --- .../shared/pdf/ConfigurationException.java | 52 ---- .../de/muehlencord/shared/pdf/Content.java | 91 ------- .../de/muehlencord/shared/pdf/Coordinate.java | 39 --- .../shared/pdf/DefaultTableRow.java | 144 ---------- .../DefaultTableRowTypeAdapterFactory.java | 40 --- .../pdf/GsonCustomizedTypeAdapterFactory.java | 89 ------ .../de/muehlencord/shared/pdf/GsonUtil.java | 45 ---- .../shared/pdf/InterfaceAdapter.java | 69 ----- .../muehlencord/shared/pdf/PDFDocument.java | 156 ----------- .../de/muehlencord/shared/pdf/PDFFont.java | 78 ------ .../shared/pdf/PDFImageContent.java | 118 -------- .../PDFImageContentTypeAdapterFactory.java | 38 --- .../muehlencord/shared/pdf/PDFPaperSize.java | 43 --- .../shared/pdf/PDFTableContent.java | 254 ------------------ .../PDFTableContentTypeAdapterFactory.java | 38 --- .../muehlencord/shared/pdf/PDFTemplate.java | 90 ------- .../shared/pdf/PDFTextAlignment.java | 26 -- .../shared/pdf/PDFTextContent.java | 109 -------- .../pdf/PDFTextContentTypeAdapterFactory.java | 38 --- .../de/muehlencord/shared/pdf/TableRow.java | 49 ---- .../shared/pdf/TemplateException.java | 40 --- .../shared/pdf/TemplateSerializeable.java | 26 -- .../muehlencord/shared/pdf/TextCellValue.java | 80 ------ .../pdf/TextCellValueTypeAdapterFactory.java | 38 --- .../muehlencord/shared/pdf/TextElement.java | 80 ------ .../shared/pdf/util/ImageUtil.java | 42 --- .../shared/pdf/DefaultTableRowTest.java | 50 ---- .../de/muehlencord/shared/pdf/Invoice.java | 79 ------ .../muehlencord/shared/pdf/InvoiceLine.java | 73 ----- .../muehlencord/shared/pdf/PDFFontTest.java | 39 --- .../shared/pdf/PDFImageContentTest.java | 46 ---- .../shared/pdf/PDFTextContentTest.java | 54 ---- .../de/muehlencord/shared/pdf/TextTest.java | 43 --- .../shared/pdf/test/GsonSerialisation.java | 78 ------ .../shared/pdf/test/PDFDocumentTest.java | 158 ----------- .../de/muehlencord/shared/pdf/test/User.java | 47 ---- .../shared/pdf/util/ImageUtilTest.java | 58 ---- .../pdf/logo-verkehrsverein-hoevelh.jpg | Bin 5041 -> 0 bytes .../pdf/test/logo-verkehrsverein-hoevelh.jpg | Bin 5041 -> 0 bytes pdf/src/test/resources/log4j.xml | 53 ---- pom.xml | 14 +- 44 files changed, 1 insertion(+), 2838 deletions(-) delete mode 100644 pdf/pom.xml delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/CellValue.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/ColumnDefinition.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/ConfigurationException.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/Content.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/Coordinate.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/DefaultTableRow.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/DefaultTableRowTypeAdapterFactory.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/GsonCustomizedTypeAdapterFactory.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/GsonUtil.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/InterfaceAdapter.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/PDFDocument.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/PDFFont.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/PDFImageContent.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/PDFImageContentTypeAdapterFactory.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/PDFPaperSize.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/PDFTableContent.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/PDFTableContentTypeAdapterFactory.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/PDFTemplate.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/PDFTextAlignment.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/PDFTextContent.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/PDFTextContentTypeAdapterFactory.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/TableRow.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/TemplateException.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/TemplateSerializeable.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/TextCellValue.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/TextCellValueTypeAdapterFactory.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/TextElement.java delete mode 100644 pdf/src/main/java/de/muehlencord/shared/pdf/util/ImageUtil.java delete mode 100644 pdf/src/test/java/de/muehlencord/shared/pdf/DefaultTableRowTest.java delete mode 100644 pdf/src/test/java/de/muehlencord/shared/pdf/Invoice.java delete mode 100644 pdf/src/test/java/de/muehlencord/shared/pdf/InvoiceLine.java delete mode 100644 pdf/src/test/java/de/muehlencord/shared/pdf/PDFFontTest.java delete mode 100644 pdf/src/test/java/de/muehlencord/shared/pdf/PDFImageContentTest.java delete mode 100644 pdf/src/test/java/de/muehlencord/shared/pdf/PDFTextContentTest.java delete mode 100644 pdf/src/test/java/de/muehlencord/shared/pdf/TextTest.java delete mode 100644 pdf/src/test/java/de/muehlencord/shared/pdf/test/GsonSerialisation.java delete mode 100644 pdf/src/test/java/de/muehlencord/shared/pdf/test/PDFDocumentTest.java delete mode 100644 pdf/src/test/java/de/muehlencord/shared/pdf/test/User.java delete mode 100644 pdf/src/test/java/de/muehlencord/shared/pdf/util/ImageUtilTest.java delete mode 100644 pdf/src/test/resources/de/muehlencord/shared/pdf/logo-verkehrsverein-hoevelh.jpg delete mode 100644 pdf/src/test/resources/de/muehlencord/shared/pdf/test/logo-verkehrsverein-hoevelh.jpg delete mode 100644 pdf/src/test/resources/log4j.xml diff --git a/pdf/pom.xml b/pdf/pom.xml deleted file mode 100644 index 16dc5e2..0000000 --- a/pdf/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - 4.0.0 - - de.muehlencord - shared - 1.2-SNAPSHOT - - - de.muehlencord.shared - shared-pdf - 1.2-SNAPSHOT - jar - - - org.freemarker - freemarker - - - org.junit.jupiter - junit-jupiter-engine - test - - - org.slf4j - slf4j-api - - - org.apache.pdfbox - pdfbox - - - com.google.code.gson - gson - - - org.slf4j - slf4j-log4j12 - test - - - commons-io - commons-io - - - org.apache.commons - commons-lang3 - - - \ No newline at end of file diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/CellValue.java b/pdf/src/main/java/de/muehlencord/shared/pdf/CellValue.java deleted file mode 100644 index c638d8f..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/CellValue.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -abstract class CellValue { - - protected abstract int getColSize(); - - protected abstract float getCellPadding(); - - -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/ColumnDefinition.java b/pdf/src/main/java/de/muehlencord/shared/pdf/ColumnDefinition.java deleted file mode 100644 index 5dbce13..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/ColumnDefinition.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.annotations.Expose; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -class ColumnDefinition { - - @Expose - private final Float width; - - protected ColumnDefinition(Float width) { - this.width = width; - } - - /* *** getter *** */ - - protected float getWidth() { - return width; - } - - -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/ConfigurationException.java b/pdf/src/main/java/de/muehlencord/shared/pdf/ConfigurationException.java deleted file mode 100644 index 3171cb3..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/ConfigurationException.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class ConfigurationException extends Exception { - - /** - * Creates a new instance of ConfigurationException without - * detail message. - */ - public ConfigurationException() { - } - - /** - * Constructs an instance of ConfigurationException with the - * specified detail message. - * - * @param msg the detail message. - */ - public ConfigurationException(String msg) { - super(msg); - } - - /** - * Constructs an instance of ConfigurationException with the - * specified detail message and the given root cause. - * - * @param msg the detail message. - * @param th the root cause. - */ - public ConfigurationException(String msg, Throwable th) { - super(msg); - } - -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/Content.java b/pdf/src/main/java/de/muehlencord/shared/pdf/Content.java deleted file mode 100644 index 3d3db35..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/Content.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.annotations.Expose; -import java.io.IOException; -import org.apache.pdfbox.pdmodel.PDPageContentStream; -import org.apache.pdfbox.pdmodel.common.PDRectangle; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -abstract class Content implements TemplateSerializeable { - - protected PDFDocument document; - protected PDRectangle rect; - - @Expose - protected Float x; - - @Expose - protected Float y; - - public Content(PDFDocument document) { - this.document = document; - this.x = null; - this.y = null; - } - - public Content(PDFDocument doc, float x, float y) { - this(doc); - this.x = x; - this.y = y; - } - - public void setDocument(PDFDocument doc) { - this.document = doc; - } - - public void setCoordinate(Coordinate coord) { - if (x == null) { - x = coord.getX(); - } - if (y == null) { - y = coord.getY(); - } - } - - protected abstract Coordinate addContentToPdf(PDPageContentStream cos) throws IOException, ConfigurationException; - - public abstract String getTemplateJsonString(); - - /* *** getter / setter *** */ - public float getX() { - return x; - } - - public void setX(float x) { - this.x = x; - } - - public float getY() { - return y; - } - - public void setY(float y) { - this.y = y; - } - - protected PDRectangle getRectangle() { - return rect; - } - - protected void setRect(PDRectangle rect) { - this.rect = rect; - } -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/Coordinate.java b/pdf/src/main/java/de/muehlencord/shared/pdf/Coordinate.java deleted file mode 100644 index aa90cbf..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/Coordinate.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -class Coordinate { - - final float x; - final float y; - - public Coordinate(float x, float y) { - this.x = x; - this.y = y; - } - - public float getX() { - return x; - } - - public float getY() { - return y; - } -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/DefaultTableRow.java b/pdf/src/main/java/de/muehlencord/shared/pdf/DefaultTableRow.java deleted file mode 100644 index 2415195..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/DefaultTableRow.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.annotations.Expose; -import java.util.ArrayList; -import java.util.List; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -class DefaultTableRow extends TableRow implements TemplateSerializeable { - - @Expose - private final List row; - - @Expose - private final List padding; - - @Expose - private Boolean isList; - - @Expose - private String listName; - - @Expose - private String varName; - - protected DefaultTableRow() { - this.row = new ArrayList<>(); - this.padding = new ArrayList<>(); - this.isList = false; - this.listName = null; - this.varName = null; - } - - @Override - public String getTemplateJsonString() { - // copy object, null values for listName and isList so they are no longer printed in the template - DefaultTableRow newRow = new DefaultTableRow (); - newRow.row.addAll(this.row); - newRow.padding.addAll(this.padding); - newRow.isList = null; - newRow.listName = null; - newRow.varName = null; - - String returnValue = GsonUtil.getInstance().toJson(newRow); - if (isList()) { - String listStartString = "<#list "; - listStartString += getListName(); - listStartString += " as "; - listStartString += getVarName(); - listStartString += ">\n"; - - String listEndString = "<#if (" + getVarName() + "?has_next)>,"; - listEndString += "\n"; - - returnValue = listStartString + returnValue + listEndString; - } - - return returnValue; - } - - @Override - protected void addColumn(TextElement element) { - row.add(element); - padding.add(null); - } - - @Override - protected void addColumn(TextElement element, float p) { - row.add(element); - padding.add(p); - } - - /* *** TableRow methods *** */ - @Override - protected int getColumnCount() { - return row.size(); - } - - @Override - protected String getColumnValue(int columnPos) { - return row.get(columnPos).getText(); - } - - @Override - protected PDFTextAlignment getAlignment(int columnPos) { - return row.get(columnPos).getAlign(); - } - - @Override - protected float getCellPadding(int columnPos) { - Float currentPadding = padding.get(columnPos); - if (currentPadding == null) { - return 0F; - } else { - return currentPadding; - } - } - - @Override - protected String getFontAlias(int columnPos) { - return row.get(columnPos).getFontAlias(); - } - - @Override - protected boolean isList() { - return isList; - } - - @Override - protected DefaultTableRow createList(String listName, String varName) { - this.listName = listName; - this.varName = varName; - this.isList = true; - return this; - } - - @Override - protected String getListName() { - return listName; - } - - @Override - protected String getVarName() { - return varName; - } - -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/DefaultTableRowTypeAdapterFactory.java b/pdf/src/main/java/de/muehlencord/shared/pdf/DefaultTableRowTypeAdapterFactory.java deleted file mode 100644 index 92f5bc8..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/DefaultTableRowTypeAdapterFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -class DefaultTableRowTypeAdapterFactory extends GsonCustomizedTypeAdapterFactory { - - protected DefaultTableRowTypeAdapterFactory() { - super(DefaultTableRow.class); - } - - @Override - protected JsonElement updateElement(JsonElement toSerialize) { - - JsonObject elem = toSerialize.getAsJsonObject(); - final JsonObject member = new JsonObject(); - member.addProperty("type", DefaultTableRow.class.getName()); - member.add("data", toSerialize.getAsJsonObject()); - return member; - } -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/GsonCustomizedTypeAdapterFactory.java b/pdf/src/main/java/de/muehlencord/shared/pdf/GsonCustomizedTypeAdapterFactory.java deleted file mode 100644 index 16ecb10..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/GsonCustomizedTypeAdapterFactory.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -abstract class GsonCustomizedTypeAdapterFactory implements TypeAdapterFactory { - - protected final Class customizedClass; - - public GsonCustomizedTypeAdapterFactory(Class customizedClass) { - this.customizedClass = customizedClass; - } - - /** - * Override this to muck with {@code toSerialize} before it is written to - * the outgoing JSON stream. - */ - protected void beforeWrite(C source, JsonElement toSerialize) { - // do nothing in default implementation - } - - /** - * Override this to muck with {@code deserialized} before it parsed into the - * application type. - */ - protected void afterRead(JsonElement deserialized) { - // do nothing in default implementation - } - - protected JsonElement updateElement(JsonElement toSerialize) { - // do nothing in default implementation - return toSerialize; - } - - @Override - public final TypeAdapter create(Gson gson, TypeToken type) { - TypeAdapter returnValue = null; - if (customizedClass.isAssignableFrom(type.getRawType())) { - returnValue = (TypeAdapter) customizeMyClassAdapter(gson, (TypeToken) type); - } - return returnValue; - } - - private TypeAdapter customizeMyClassAdapter(Gson gson, TypeToken type) { - final TypeAdapter delegate = gson.getDelegateAdapter(this, type); - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - return new TypeAdapter() { - @Override - public void write(JsonWriter out, C value) throws IOException { - JsonElement tree = delegate.toJsonTree(value); - tree = updateElement(tree); - beforeWrite(value, tree); - elementAdapter.write(out, tree); - } - - @Override - public C read(JsonReader in) throws IOException { - JsonElement tree = elementAdapter.read(in); - afterRead(tree); - return delegate.fromJsonTree(tree); - } - }; - } -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/GsonUtil.java b/pdf/src/main/java/de/muehlencord/shared/pdf/GsonUtil.java deleted file mode 100644 index 1421337..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/GsonUtil.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -class GsonUtil { - - private final static Gson INSTANCE = new GsonBuilder() - .setPrettyPrinting() - .excludeFieldsWithoutExposeAnnotation() - .registerTypeAdapter(Content.class, new InterfaceAdapter<>()) - .registerTypeAdapter(TableRow.class, new InterfaceAdapter<>()) - .registerTypeAdapter(CellValue.class, new InterfaceAdapter<>()) - .registerTypeAdapterFactory(new PDFImageContentTypeAdapterFactory()) - .registerTypeAdapterFactory(new PDFTableContentTypeAdapterFactory()) - .registerTypeAdapterFactory(new PDFTextContentTypeAdapterFactory()) - .registerTypeAdapterFactory(new DefaultTableRowTypeAdapterFactory()) - .registerTypeAdapterFactory(new TextCellValueTypeAdapterFactory()) - .create(); - - protected final static Gson getInstance() { - return INSTANCE; - } - -} - diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/InterfaceAdapter.java b/pdf/src/main/java/de/muehlencord/shared/pdf/InterfaceAdapter.java deleted file mode 100644 index 018cc6d..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/InterfaceAdapter.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import java.lang.reflect.Type; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -class InterfaceAdapter implements JsonSerializer, JsonDeserializer { - - @Override - public final JsonElement serialize(final T object, final Type interfaceType, final JsonSerializationContext context) { - final JsonObject member = new JsonObject(); - member.addProperty("type", object.getClass().getName()); - member.add("data", context.serialize(object, object.getClass())); - return member; - } - - @Override - public final T deserialize(final JsonElement elem, final Type interfaceType, final JsonDeserializationContext context) throws JsonParseException { - final JsonObject member = (JsonObject) elem; - final JsonElement typeString = get(member, "type"); - final JsonElement data = get(member, "data"); - final Type actualType = typeForName(typeString); - - return context.deserialize(data, actualType); - } - - private Type typeForName(final JsonElement typeElem) { - try { - return Class.forName(typeElem.getAsString()); - } catch (ClassNotFoundException e) { - throw new JsonParseException(e); - } - } - - private JsonElement get(final JsonObject wrapper, final String memberName) { - final JsonElement elem = wrapper.get(memberName); - - if (elem == null) { - throw new JsonParseException( - "no '" + memberName + "' member found in json file."); - } - return elem; - } - -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFDocument.java b/pdf/src/main/java/de/muehlencord/shared/pdf/PDFDocument.java deleted file mode 100644 index d489c5c..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFDocument.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.annotations.Expose; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.ConcurrentHashMap; -import org.apache.pdfbox.pdmodel.PDDocument; -import org.apache.pdfbox.pdmodel.font.PDFont; -import org.apache.pdfbox.pdmodel.font.PDType1Font; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class PDFDocument { - - @Expose - private final PDFPaperSize paperSize; - - @Expose - protected PDFFont standardFont; - - @Expose - protected Map fontMap; - - @Expose - private final List contentList; - - private PDDocument pdDocument; - - public PDFDocument(PDFPaperSize ps) { - this.paperSize = ps; - this.contentList = new ArrayList<>(); - this.standardFont = new PDFFont("Helvetica", 11); - this.fontMap = null; - } - - public String getTemplateString() { - StringBuilder sb = new StringBuilder(); - int indent = 0; // TODO add indent support - sb.append("{\n"); - - // paper size - sb.append("\"paperSize\": "); - sb.append(paperSize.getTemplateJsonString()); - sb.append(",\n"); - - // standardFOnt - sb.append ("\"standardFont\": "); - sb.append (standardFont.getTemplateJsonString()); - sb.append (",\n"); - - - sb.append("\"fontMap\": {\n"); - Iterator> it = fontMap.entrySet().iterator(); - while (it.hasNext()) { - Entry entry = it.next(); - sb.append("\"").append(entry.getKey()).append("\": "); - sb.append (entry.getValue().getTemplateJsonString()); - if (it.hasNext()) { - sb.append(","); - } - sb.append("\n"); - } - sb.append ("},\n"); // fontMap - - sb.append ("\"contentList\": [\n"); - Iterator contentIterator = contentList.iterator(); - while (contentIterator.hasNext()) { - Content content = contentIterator.next(); - String contentString = content.getTemplateJsonString(); - sb.append (contentString); - if (contentIterator.hasNext()) - sb.append (","); - sb.append ("\n"); - } - sb.append ("]\n"); - - sb.append("}"); // closing pdfDocument - return sb.toString(); - } - - public void addFont(String name, PDFFont font) { - if (fontMap == null) { - fontMap = new ConcurrentHashMap<>(); - } - fontMap.put(name, font); - } - - protected PDFont getFont(String fontName) throws ConfigurationException { - if (fontName.equals(PDType1Font.HELVETICA.getBaseFont())) { - return PDType1Font.HELVETICA; - } else if (fontName.equals(PDType1Font.HELVETICA_BOLD.getBaseFont())) { - return PDType1Font.HELVETICA_BOLD; - } else { - throw new ConfigurationException("Font " + fontName + " not supported"); - } - } - - public PDFFont getFontByAlias(String fontAlias) throws ConfigurationException { - if ((fontMap != null) && (fontMap.containsKey(fontAlias))) { - return fontMap.get(fontAlias); - } else { - throw new ConfigurationException("Font " + fontAlias + " not found in mapping. "); - } - } - - public PDFDocument addContent(Content content) { - contentList.add(content); - return this; - } - - /* *** getter / setter *** */ - public PDFPaperSize getPaperSize() { - return paperSize; - } - - public PDFFont getStandardFont() { - return standardFont; - } - - public void setStandardFont(PDFFont standardFont) { - this.standardFont = standardFont; - } - - public List getContentList() { - return contentList; - } - - public PDDocument getPdDocument() { - return pdDocument; - } - - public void setPdDocument(PDDocument pdDocument) { - this.pdDocument = pdDocument; - } - -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFFont.java b/pdf/src/main/java/de/muehlencord/shared/pdf/PDFFont.java deleted file mode 100644 index 3abf1cf..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFFont.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.annotations.Expose; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class PDFFont implements TemplateSerializeable { - - @Expose - private String fontName; - @Expose - private int fontSize; - @Expose - private int padding; - - public PDFFont(String fontName, int fontSize) { - this.fontName = fontName; - this.fontSize = fontSize; - this.padding = 2; - } - - public PDFFont(String fontName, int fontSize, int padding) { - this.fontName = fontName; - this.fontSize = fontSize; - this.padding = padding; - } - - @Override - public String getTemplateJsonString() { - return GsonUtil.getInstance().toJson (this); - } - - - - /* *** getter / setter *** */ - - public String getFontName() { - return fontName; - } - - public void setFontName(String fontName) { - this.fontName = fontName; - } - - public int getFontSize() { - return fontSize; - } - - public void setFontSize(int fontSize) { - this.fontSize = fontSize; - } - - public int getPadding() { - return padding; - } - - public void setPadding(int padding) { - this.padding = padding; - } - -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFImageContent.java b/pdf/src/main/java/de/muehlencord/shared/pdf/PDFImageContent.java deleted file mode 100644 index 695b4cd..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFImageContent.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.annotations.Expose; -import de.muehlencord.shared.pdf.util.ImageUtil; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import javax.imageio.ImageIO; -import org.apache.pdfbox.pdmodel.PDPageContentStream; -import org.apache.pdfbox.pdmodel.graphics.image.LosslessFactory; -import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class PDFImageContent extends Content implements TemplateSerializeable { - - @Expose - private Float scale = null; - - @Expose - private String base64CodedImage = null; - - public PDFImageContent(PDFDocument document, String contentString) throws IOException { - super(document); - this.base64CodedImage = contentString; - } - - public PDFImageContent(PDFDocument document, File file) throws IOException { - super(document); - this.base64CodedImage = ImageUtil.getEncodedString(ImageIO.read(file)); - } - - public PDFImageContent(PDFDocument document, BufferedImage img) throws IOException { - super(document); - this.base64CodedImage = ImageUtil.getEncodedString(img); - } - - public PDFImageContent(PDFDocument document, float x, float y, String contentString) throws IOException { - super(document, x, y); - this.base64CodedImage = contentString; - } - - public PDFImageContent(PDFDocument document, float x, float y, File file) throws IOException { - super(document, x, y); - this.base64CodedImage = ImageUtil.getEncodedString(ImageIO.read(file)); - } - - public PDFImageContent(PDFDocument document, float x, float y, BufferedImage img) throws IOException { - super(document, x, y); - this.base64CodedImage = ImageUtil.getEncodedString(img); - } - - public PDFImageContent(PDFDocument document, float x, float y, float scale, String contentString) throws IOException { - super(document, x, y); - this.scale = scale; - this.base64CodedImage = contentString; - } - - public PDFImageContent(PDFDocument document, float x, float y, float scale, File file) throws IOException { - super(document, x, y); - this.scale = scale; - this.base64CodedImage = ImageUtil.getEncodedString(ImageIO.read(file)); - } - - public PDFImageContent(PDFDocument document, float x, float y, float scale, BufferedImage img) throws IOException { - super(document, x, y); - this.scale = scale; - this.base64CodedImage = ImageUtil.getEncodedString(img); - } - - - /** - * defaut toJson implementation uses standard JSON string - * @return - */ - @Override - public String getTemplateJsonString() { - String returnValue = GsonUtil.getInstance().toJson(this); - return returnValue; - } - - @Override - protected Coordinate addContentToPdf(PDPageContentStream cos) throws IOException, ConfigurationException { - BufferedImage image = ImageUtil.getImageFromEncodedString(base64CodedImage); - PDImageXObject pdImage = LosslessFactory.createFromImage(document.getPdDocument(), image); - - float height = pdImage.getHeight() * getScale(); - float width = pdImage.getWidth() * getScale(); - cos.drawImage(pdImage, x, y, width, height); - return new Coordinate(x, y - height); - } - - /* *** getter / setter */ - public float getScale() { - if (scale == null) { - return 1F; - } else { - return scale; - } - } -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFImageContentTypeAdapterFactory.java b/pdf/src/main/java/de/muehlencord/shared/pdf/PDFImageContentTypeAdapterFactory.java deleted file mode 100644 index 0798c56..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFImageContentTypeAdapterFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -class PDFImageContentTypeAdapterFactory extends GsonCustomizedTypeAdapterFactory { - - protected PDFImageContentTypeAdapterFactory() { - super(PDFImageContent.class); - } - - @Override - protected JsonElement updateElement(JsonElement toSerialize) { - final JsonObject member = new JsonObject(); - member.addProperty("type", PDFImageContent.class.getName()); - member.add("data", toSerialize.getAsJsonObject()); - return member; - } -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFPaperSize.java b/pdf/src/main/java/de/muehlencord/shared/pdf/PDFPaperSize.java deleted file mode 100644 index def4ac2..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFPaperSize.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public enum PDFPaperSize implements TemplateSerializeable { - - A4("A4"); - - private String label; - - private PDFPaperSize(String label) { - this.label = label; - } - - public String getLabel() { - return label; - } - - @Override - public String getTemplateJsonString() { - return GsonUtil.getInstance().toJson(this); - } - - - -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTableContent.java b/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTableContent.java deleted file mode 100644 index 2add8e0..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTableContent.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.Gson; -import com.google.gson.annotations.Expose; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import org.apache.pdfbox.pdmodel.PDPageContentStream; -import org.apache.pdfbox.pdmodel.font.PDFont; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class PDFTableContent extends Content { - - private static final Logger LOGGER = LoggerFactory.getLogger(PDFTableContent.class); - - @Expose - private final List columSizes; - - @Expose - private List data = null; - - public PDFTableContent(PDFDocument doc, PDFFont hf) { - super(doc); - this.columSizes = new ArrayList<>(); - this.data = new ArrayList<>(); - - } - - public PDFTableContent(PDFDocument doc, PDFFont hf, float x, float y) { - super(doc, x, y); - this.columSizes = new ArrayList<>(); - this.data = new ArrayList<>(); - } - - /** - * defaut toJson implementation uses standard JSON string - * - * @return - */ - @Override - public String getTemplateJsonString() { - Gson gson = GsonUtil.getInstance(); - StringBuilder sb = new StringBuilder(); - sb.append ("{\n"); - sb.append ("\"type\": "); - sb.append ("\"").append(this.getClass().getName()).append ("\",\n"); - sb.append ("\"data\": {"); - sb.append ("\"columSizes\": "); - sb.append (gson.toJson(columSizes)); - sb.append (",\"data\": ["); - Iterator it = data.iterator(); - while (it.hasNext()) { - TableRow row = it.next(); - sb.append (row.getTemplateJsonString()); - if (it.hasNext()) { - sb.append (",\n"); - } - } - sb.append ("]\n"); // data array - sb.append ("}\n"); // data list - sb.append ("}\n"); // pdf table object - - return sb.toString(); - // return GsonUtil.getInstance().toJson(this); - } - - public PDFTableContent addColumn(float size) { - // TODO check if enough columns are defined - this.columSizes.add(new ColumnDefinition(size)); - return this; - } - - public PDFTableContent addColumn(float... sizes) { - // TODO check if enough columns are defined - for (float size : sizes) { - addColumn(size); - } - return this; - } - - public PDFTableContent addRow() { - DefaultTableRow newRow = new DefaultTableRow(); - data.add(newRow); - return this; - } - - public PDFTableContent addListRow(String listName, String varName) { - DefaultTableRow newRow = new DefaultTableRow(); - newRow.createList(listName, varName); - data.add(newRow); - return this; - } - - public PDFTableContent addRow(String... values) throws ConfigurationException { - return PDFTableContent.this.addRow(Arrays.asList(values)); - } - - public PDFTableContent addRow(List values) throws ConfigurationException { - DefaultTableRow newRow = new DefaultTableRow(); - data.add(newRow); - if (values.size() != columSizes.size()) { - throw new ConfigurationException("Table defines " + columSizes.size() + " columns, but " + values.size() + " columns given"); - } - validateConfiguration(newRow, false); - for (String cellText : values) { - PDFTableContent.this.setCellValue(cellText); - } - return this; - } - - public PDFTableContent setCellValue(String text) throws ConfigurationException { - TableRow lastRow = data.get(data.size() - 1); - validateConfiguration(lastRow, true); - lastRow.addColumn(new TextElement(text)); - return this; - } - - public PDFTableContent setCellValue(String text, String fontAlias) throws ConfigurationException { - TableRow lastRow = data.get(data.size() - 1); - validateConfiguration(lastRow, true); - data.get(data.size() - 1).addColumn(new TextElement(text, fontAlias)); - return this; - } - - public PDFTableContent setCellValue(String text, float padding) throws ConfigurationException { - TableRow lastRow = data.get(data.size() - 1); - validateConfiguration(lastRow, true); - lastRow.addColumn(new TextElement(text), padding); - return this; - } - - public PDFTableContent setCellValue(String text, String fontAlias, float padding) throws ConfigurationException { - TableRow lastRow = data.get(data.size() - 1); - validateConfiguration(lastRow, true); - lastRow.addColumn(new TextElement(text, fontAlias), padding); - return this; - } - - public PDFTableContent setCellValue(String text, PDFTextAlignment alignment) throws ConfigurationException { - TableRow lastRow = data.get(data.size() - 1); - validateConfiguration(lastRow, true); - lastRow.addColumn(new TextElement(text, alignment)); - return this; - } - - public PDFTableContent setCellValue(String text, String fontAlias, PDFTextAlignment alignment) throws ConfigurationException { - if (data.isEmpty()) { - throw new ConfigurationException("Need to call newRow first"); - } - data.get(data.size() - 1).addColumn(new TextElement(text, fontAlias, alignment)); - return this; - } - - public PDFTableContent setCellValue(String text, PDFTextAlignment alignment, float padding) throws ConfigurationException { - if (data.isEmpty()) { - throw new ConfigurationException("Need to call newRow first"); - } - data.get(data.size() - 1).addColumn(new TextElement(text, alignment), padding); - return this; - } - - @Override - protected Coordinate addContentToPdf(PDPageContentStream cos) throws IOException, ConfigurationException { - cos.beginText(); - - int xOffSet = 0; - for (int i = 0; i < columSizes.size(); i++) { - xOffSet -= columSizes.get(i).getWidth(); - } - int yOffset = document.getStandardFont().getFontSize() * -1 - document.getStandardFont().getPadding(); - float currentX = x; - float currentY = y; - - cos.newLineAtOffset(x, y); - - for (int lineNo = 0; lineNo < data.size(); lineNo++) { - TableRow currentRow = data.get(lineNo); - for (int colNo = 0; colNo < currentRow.getColumnCount(); colNo++) { - String currentColText = currentRow.getColumnValue(colNo); - PDFTextAlignment currentColAlignment = currentRow.getAlignment(colNo); - float cellPadding = currentRow.getCellPadding(colNo); - float colWidth = columSizes.get(colNo).getWidth(); - String fontAlias = currentRow.getFontAlias(colNo); - PDFFont font; - int fontSize; - if (fontAlias != null) { - font = document.getFontByAlias(fontAlias); - fontSize = document.getFontByAlias(fontAlias).getFontSize(); - } else { - font = document.getStandardFont(); - fontSize = document.getStandardFont().getFontSize(); - } - PDFont pdFont = document.getFont(font.getFontName()); - cos.setFont(pdFont, fontSize); - - float startX; - // FIXME duplication with header and textContent object - if (currentColAlignment == PDFTextAlignment.RIGHT) { - float textWdith = (pdFont.getStringWidth(currentColText) / 1000F) * fontSize; - float width = colWidth - (2F * cellPadding); - startX = width - textWdith; - LOGGER.info("Text width for {} = {}", currentColText, textWdith); - cos.newLineAtOffset(startX, 0); - } else { - startX = 0; - } - - cos.showText(currentColText); - cos.newLineAtOffset(columSizes.get(colNo).getWidth() - startX, 0); - } - cos.newLineAtOffset(xOffSet, yOffset); - currentY += yOffset; - } - currentY += yOffset; - - cos.endText(); - - return new Coordinate(currentX, currentY); - } - - private void validateConfiguration(TableRow lastRow, boolean calledFromSetCellValue) throws ConfigurationException { - if (data.isEmpty()) { - throw new ConfigurationException("Need to call newRow first"); - } - if (calledFromSetCellValue) { - if (lastRow.getColumnCount() >= columSizes.size()) { - throw new ConfigurationException("Cannot add more columns than defined"); - } - } - - } -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTableContentTypeAdapterFactory.java b/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTableContentTypeAdapterFactory.java deleted file mode 100644 index a00e9f0..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTableContentTypeAdapterFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -class PDFTableContentTypeAdapterFactory extends GsonCustomizedTypeAdapterFactory { - - protected PDFTableContentTypeAdapterFactory() { - super(PDFTableContent.class); - } - - @Override - protected JsonElement updateElement(JsonElement toSerialize) { - final JsonObject member = new JsonObject(); - member.addProperty("type", PDFTableContent.class.getName()); - member.add("data", toSerialize.getAsJsonObject()); - return member; - } -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTemplate.java b/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTemplate.java deleted file mode 100644 index 26f95a3..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTemplate.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.Gson; -import freemarker.template.Template; -import freemarker.template.TemplateException; -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; -import java.util.concurrent.ConcurrentHashMap; -import org.apache.pdfbox.pdmodel.PDDocument; -import org.apache.pdfbox.pdmodel.PDPage; -import org.apache.pdfbox.pdmodel.PDPageContentStream; -import org.apache.pdfbox.pdmodel.PDPageContentStream.AppendMode; -import org.apache.pdfbox.pdmodel.common.PDRectangle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class PDFTemplate { - - private static final Logger LOGGER = LoggerFactory.getLogger(PDFTemplate.class); - - public final static String A4 = "A4"; - - private final Template template; - private final ConcurrentHashMap dataModel; - - public PDFTemplate(Template template) { - this.template = template; - this.dataModel = new ConcurrentHashMap<>(); - } - - public void addToDatamodel(String key, Object value) { - this.dataModel.put(key, value); - } - - public void create(String filenName) throws ConfigurationException, IOException { - Writer out = new StringWriter(); - try { - template.process(dataModel, out); - } catch (TemplateException ex) { - throw new IOException("Error while processing template", ex); - } - String json = out.toString(); - LOGGER.debug(json); - - Gson gson = GsonUtil.getInstance(); - PDFDocument pdfDoc = gson.fromJson(json, PDFDocument.class); - pdfDoc.setPdDocument(new PDDocument()); - - PDPage page; - switch (pdfDoc.getPaperSize()) { - case A4: - page = new PDPage(PDRectangle.A4); - break; - default: - throw new ConfigurationException("Papersize " + pdfDoc.getPaperSize().getLabel() + " not supported"); - } - pdfDoc.getPdDocument().addPage(page); - - try (PDPageContentStream cos = new PDPageContentStream(pdfDoc.getPdDocument(), page, AppendMode.APPEND, false)) { - Coordinate coord = new Coordinate(page.getMediaBox().getLowerLeftX(), page.getMediaBox().getUpperRightY()); - for (Content content : pdfDoc.getContentList()) { - content.setDocument(pdfDoc); // FIXME move to serialization - content.setRect(page.getMediaBox()); - content.setCoordinate(coord); - coord = content.addContentToPdf(cos); - } - } - pdfDoc.getPdDocument().save(filenName); - } -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTextAlignment.java b/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTextAlignment.java deleted file mode 100644 index 1c71f7c..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTextAlignment.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public enum PDFTextAlignment { - - LEFT, - RIGHT; -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTextContent.java b/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTextContent.java deleted file mode 100644 index 1172878..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTextContent.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.annotations.Expose; -import java.io.IOException; -import java.util.LinkedList; -import java.util.List; -import org.apache.pdfbox.pdmodel.PDPageContentStream; -import org.apache.pdfbox.pdmodel.font.PDFont; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class PDFTextContent extends Content { - - @Expose - private final List textLines; - - public PDFTextContent(PDFDocument doc) { - super(doc); - this.textLines = new LinkedList<>(); - } - - public PDFTextContent(PDFDocument doc, float x, float y) { - super(doc, x, y); - this.textLines = new LinkedList<>(); - } - - public PDFTextContent(PDFDocument doc, float x, float y, String text) { - super(doc, x, y); - this.textLines = new LinkedList<>(); - this.textLines.add(new TextElement(text)); - } - - /** - * defaut toJson implementation uses standard JSON string - * - * @return - */ - @Override - public String getTemplateJsonString() { - String returnValue = GsonUtil.getInstance().toJson(this); - return returnValue; - } - - public PDFTextContent addLine() { - this.textLines.add(new TextElement()); - return this; - } - - public PDFTextContent addLine(String text) { - this.textLines.add(new TextElement(text)); - return this; - } - - public PDFTextContent addLine(String text, PDFTextAlignment align) { - this.textLines.add(new TextElement(text, align)); - return this; - } - - public PDFTextContent addLine(String text, String fontAlias) { - this.textLines.add(new TextElement(text, fontAlias)); - return this; - } - - /* *** getter / setter */ - @Override - protected Coordinate addContentToPdf(PDPageContentStream cos) throws IOException, ConfigurationException { - float margin = 40F; - cos.beginText(); - cos.newLineAtOffset(x, y); - float currentY = y; - for (TextElement textLine : textLines) { - PDFFont font = (textLine.getFontAlias() == null ? document.getStandardFont() : document.getFontByAlias(textLine.getFontAlias())); - PDFont pdFont = document.getFont(font.getFontName()); - cos.setFont(pdFont, font.getFontSize()); - int leading = font.getFontSize() + font.getPadding(); - - if (textLine.getAlign() == PDFTextAlignment.RIGHT) { - float textWdith = (pdFont.getStringWidth(textLine.getText()) / 1000F) * font.getFontSize(); - float width = rect.getUpperRightX() - rect.getLowerLeftX() - 2 * margin; - float startX = width - textWdith; - cos.newLineAtOffset(startX, 0); - } - currentY -= leading; - cos.setLeading(leading); - cos.showText(textLine.getText()); - cos.newLine(); - } - cos.endText(); - - return new Coordinate(x, currentY); - } -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTextContentTypeAdapterFactory.java b/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTextContentTypeAdapterFactory.java deleted file mode 100644 index 99ef78b..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/PDFTextContentTypeAdapterFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -class PDFTextContentTypeAdapterFactory extends GsonCustomizedTypeAdapterFactory { - - protected PDFTextContentTypeAdapterFactory() { - super(PDFTextContent.class); - } - - @Override - protected JsonElement updateElement(JsonElement toSerialize) { - final JsonObject member = new JsonObject(); - member.addProperty("type", PDFTextContent.class.getName()); - member.add("data", toSerialize.getAsJsonObject()); - return member; - } -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/TableRow.java b/pdf/src/main/java/de/muehlencord/shared/pdf/TableRow.java deleted file mode 100644 index 4454232..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/TableRow.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -abstract class TableRow implements TemplateSerializeable { - - protected abstract TableRow createList(String listName, String varName); - - protected abstract int getColumnCount(); - - protected abstract boolean isList(); - - protected abstract String getColumnValue(int columnPos); - - protected abstract PDFTextAlignment getAlignment(int columnPos); - - protected abstract float getCellPadding (int columnPos); - - protected abstract String getFontAlias(int columnPos); - - protected abstract String getListName(); - - protected abstract String getVarName(); - - protected abstract void addColumn(TextElement element); - - protected abstract void addColumn(TextElement element, float padding); - - - - -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/TemplateException.java b/pdf/src/main/java/de/muehlencord/shared/pdf/TemplateException.java deleted file mode 100644 index 52c6bbb..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/TemplateException.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class TemplateException extends Exception { - - /** - * Creates a new instance of TemplateException without detail - * message. - */ - public TemplateException() { - } - - /** - * Constructs an instance of TemplateException with the - * specified detail message. - * - * @param msg the detail message. - */ - public TemplateException(String msg) { - super(msg); - } -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/TemplateSerializeable.java b/pdf/src/main/java/de/muehlencord/shared/pdf/TemplateSerializeable.java deleted file mode 100644 index 0f729ee..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/TemplateSerializeable.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -interface TemplateSerializeable { - - String getTemplateJsonString(); - -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/TextCellValue.java b/pdf/src/main/java/de/muehlencord/shared/pdf/TextCellValue.java deleted file mode 100644 index 7bbabdd..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/TextCellValue.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.annotations.Expose; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -class TextCellValue extends CellValue { - - @Expose - private final TextElement cellValue; - @Expose - private final Integer colSize; - @Expose - private final Float cellPadding; - - public TextCellValue(String cellValue, int colSizes) { - this.cellValue = new TextElement(cellValue); - this.colSize = colSizes; - this.cellPadding = null; - } - - public TextCellValue(String cellValue, int colSizes, float cellPadding) { - this.cellValue = new TextElement(cellValue); - this.colSize = colSizes; - this.cellPadding = cellPadding; - } - - public TextCellValue(String cellValue, int colSizes, PDFTextAlignment align) { - this.cellValue = new TextElement(cellValue, align); - this.colSize = colSizes; - this.cellPadding = null; - } - - public TextCellValue(String cellValue, int colSize, PDFTextAlignment align, float cellPadding) { - this.cellValue = new TextElement(cellValue, align); - this.colSize = colSize; - this.cellPadding = cellPadding; - } - - /* *** getter / setter *** */ - public String getCellText() { - return cellValue.getText(); - } - - public PDFTextAlignment getAlignment() { - return cellValue.getAlign(); - } - - @Override - public int getColSize() { - return colSize; - } - - @Override - public float getCellPadding() { - if (cellPadding == null) { - return 0F; - } else { - return cellPadding; - } - } - -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/TextCellValueTypeAdapterFactory.java b/pdf/src/main/java/de/muehlencord/shared/pdf/TextCellValueTypeAdapterFactory.java deleted file mode 100644 index cc7512b..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/TextCellValueTypeAdapterFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -class TextCellValueTypeAdapterFactory extends GsonCustomizedTypeAdapterFactory { - - protected TextCellValueTypeAdapterFactory() { - super(TextCellValue.class); - } - - @Override - protected JsonElement updateElement(JsonElement toSerialize) { - final JsonObject member = new JsonObject(); - member.addProperty("type", TextCellValue.class.getName()); - member.add("data", toSerialize.getAsJsonObject()); - return member; - } -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/TextElement.java b/pdf/src/main/java/de/muehlencord/shared/pdf/TextElement.java deleted file mode 100644 index ab7572b..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/TextElement.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.annotations.Expose; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -class TextElement { - - @Expose - private final String text; - @Expose - private final String fontAlias; - @Expose - private final PDFTextAlignment align; - - public TextElement() { - this.text = ""; - this.fontAlias = null; - this.align = null; - } - - public TextElement(String text) { - this.text = text; - this.fontAlias = null; - this.align = null; - } - - public TextElement(String text, PDFTextAlignment align) { - this.text = text; - this.fontAlias = null; - this.align = align; - } - - public TextElement(String text, String fontAlias) { - this.text = text; - this.fontAlias = fontAlias; - this.align = null; - } - - public TextElement(String text, String fontAlias, PDFTextAlignment align) { - this.text = text; - this.fontAlias = fontAlias; - this.align = align; - } - - /* *** getter / setter *** */ - public String getText() { - return text; - } - - public String getFontAlias() { - return fontAlias; - } - - public PDFTextAlignment getAlign() { - if (align == null) { - return PDFTextAlignment.LEFT; - } else { - return align; - } - } - -} diff --git a/pdf/src/main/java/de/muehlencord/shared/pdf/util/ImageUtil.java b/pdf/src/main/java/de/muehlencord/shared/pdf/util/ImageUtil.java deleted file mode 100644 index 52aaedb..0000000 --- a/pdf/src/main/java/de/muehlencord/shared/pdf/util/ImageUtil.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf.util; - -import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.Base64; -import javax.imageio.ImageIO; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class ImageUtil { - - public static String getEncodedString(BufferedImage img) throws IOException { - final ByteArrayOutputStream os = new ByteArrayOutputStream(); - ImageIO.write(img, "png", Base64.getEncoder().wrap(os)); - return os.toString(StandardCharsets.UTF_8.name()); - } - - public static BufferedImage getImageFromEncodedString(String base64CodedString) throws IOException { - return ImageIO.read(new ByteArrayInputStream(Base64.getDecoder().decode(base64CodedString))); - } - -} diff --git a/pdf/src/test/java/de/muehlencord/shared/pdf/DefaultTableRowTest.java b/pdf/src/test/java/de/muehlencord/shared/pdf/DefaultTableRowTest.java deleted file mode 100644 index c5468b1..0000000 --- a/pdf/src/test/java/de/muehlencord/shared/pdf/DefaultTableRowTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import org.junit.jupiter.api.Test; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class DefaultTableRowTest { - - @Test - public void testFromJson() { - String jsonString = "{\n" - + " \"type\": \"de.muehlencord.shared.pdf.DefaultTableRow\",\n" - + " \"data\": {\n" - + " \"row\": [\n" - + " {\n" - + " \"text\": \"Rechnungs-Nr.:\"\n" - + " },\n" - + " {\n" - + " \"text\": \"${invoiceNumber}\"\n" - + " }\n" - + " ],\n" - + " \"isList\": false\n" - + " }\n" - + " }"; - - TableRow tableRow = GsonUtil.getInstance().fromJson(jsonString, TableRow.class); - assertFalse(tableRow == null, "tableRowObject"); - assertEquals(2, tableRow.getColumnCount(), "column count"); - assertFalse(tableRow.isList(), "isList"); - } -} diff --git a/pdf/src/test/java/de/muehlencord/shared/pdf/Invoice.java b/pdf/src/test/java/de/muehlencord/shared/pdf/Invoice.java deleted file mode 100644 index a344d31..0000000 --- a/pdf/src/test/java/de/muehlencord/shared/pdf/Invoice.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class Invoice { - - private final List invoiceLines; - - private Date invoiceDate; - private String customerNumber; - private String invoiceNumber; - private String logo = null; - - public Invoice() { - this.invoiceLines = new ArrayList<>(); - } - - public void addInvoiceLine(InvoiceLine il) { - this.invoiceLines.add(il); - } - - /* *** getter / setter *** */ - public List getInvoiceLines() { - return invoiceLines; - } - - public String getLogo() { - return logo; - } - - public void setLogo(String logo) { - this.logo = logo; - } - - public Date getInvoiceDate() { - return invoiceDate; - } - - public void setInvoiceDate(Date invoiceDate) { - this.invoiceDate = invoiceDate; - } - - public String getCustomerNumber() { - return customerNumber; - } - - public void setCustomerNumber(String customerNumber) { - this.customerNumber = customerNumber; - } - - public String getInvoiceNumber() { - return invoiceNumber; - } - - public void setInvoiceNumber(String invoiceNumber) { - this.invoiceNumber = invoiceNumber; - } -} diff --git a/pdf/src/test/java/de/muehlencord/shared/pdf/InvoiceLine.java b/pdf/src/test/java/de/muehlencord/shared/pdf/InvoiceLine.java deleted file mode 100644 index 6bc28f8..0000000 --- a/pdf/src/test/java/de/muehlencord/shared/pdf/InvoiceLine.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class InvoiceLine { - - private String description; - private String price; - private String amount; - private String total; - - public InvoiceLine(String description, String price, String amount, String total) { - this.description = description; - this.price = price; - this.amount = amount; - this.total = total; - } - - - - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - - public String getAmount() { - return amount; - } - - public void setAmount(String amount) { - this.amount = amount; - } - - public String getTotal() { - return total; - } - - public void setTotal(String total) { - this.total = total; - } - - - -} diff --git a/pdf/src/test/java/de/muehlencord/shared/pdf/PDFFontTest.java b/pdf/src/test/java/de/muehlencord/shared/pdf/PDFFontTest.java deleted file mode 100644 index b9378c6..0000000 --- a/pdf/src/test/java/de/muehlencord/shared/pdf/PDFFontTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.jupiter.api.Test; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class PDFFontTest { - - public PDFFontTest() { - } - - @Test - public void testTemplateSerialisation() { - PDFFont font = new PDFFont("Test", 12, 0); - String gsonString = GsonUtil.getInstance().toJson(font); - String templateString = font.getTemplateJsonString(); - System.out.println(templateString); - assertEquals(gsonString, templateString); - } - -} diff --git a/pdf/src/test/java/de/muehlencord/shared/pdf/PDFImageContentTest.java b/pdf/src/test/java/de/muehlencord/shared/pdf/PDFImageContentTest.java deleted file mode 100644 index 214f6ed..0000000 --- a/pdf/src/test/java/de/muehlencord/shared/pdf/PDFImageContentTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.net.URL; -import org.junit.jupiter.api.Test; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class PDFImageContentTest { - - public PDFImageContentTest() { - } - - @Test - public void testImage() throws IOException, URISyntaxException { - - URL urlLogo = PDFImageContentTest.class.getResource("logo-verkehrsverein-hoevelh.jpg"); - File imageFile = new File (urlLogo.toURI()); - - PDFDocument doc = new PDFDocument(PDFPaperSize.A4); - PDFImageContent logoContent = new PDFImageContent(doc, 400F, 700F, 0.6F, imageFile); - - System.out.println(GsonUtil.getInstance().toJson(logoContent)); - System.out.println(GsonUtil.getInstance().toJson(logoContent)); - } - -} diff --git a/pdf/src/test/java/de/muehlencord/shared/pdf/PDFTextContentTest.java b/pdf/src/test/java/de/muehlencord/shared/pdf/PDFTextContentTest.java deleted file mode 100644 index c61d9d5..0000000 --- a/pdf/src/test/java/de/muehlencord/shared/pdf/PDFTextContentTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import org.junit.jupiter.api.Test; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class PDFTextContentTest { - - @Test - public void testSomeMethod() { - PDFDocument doc = new PDFDocument(PDFPaperSize.A4); - PDFTextContent informationContent = new PDFTextContent(doc, 400F, 662F); - informationContent.addLine("Anzeigenabrechnung", "bold"); - informationContent.addLine("Veronika Mühlencord", "helv12"); - informationContent.addLine("Telefon: 05257/940154", "helv12"); - informationContent.addLine("Telefax: 05257/940156", "helv12"); - informationContent.addLine(); - informationContent.addLine("Hövelhof, den ${invoice.invoiceDate?date}", "bold"); - doc.addContent(informationContent); - - // System.out.println (informationContent.getTemplateJsonString()); - // System.out.println ("*****"); - // System.out.println (GsonUtil.getGsonInstance().toJson(informationContent)); - System.out.println("*****"); - - Gson gson = new GsonBuilder() - .registerTypeAdapterFactory(new PDFImageContentTypeAdapterFactory()) - .setPrettyPrinting() - .excludeFieldsWithoutExposeAnnotation() - .create(); - - System.out.println(gson.toJson(informationContent, PDFTextContent.class)); - } - -} diff --git a/pdf/src/test/java/de/muehlencord/shared/pdf/TextTest.java b/pdf/src/test/java/de/muehlencord/shared/pdf/TextTest.java deleted file mode 100644 index 11f3916..0000000 --- a/pdf/src/test/java/de/muehlencord/shared/pdf/TextTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import org.junit.jupiter.api.Test; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class TextTest { - - public TextTest() { - } - - @Test - public void testFromJson() { - String jsonString = "{\n" - + "\"text\": \"Rechnungs-Nr.:\"\n" - + "}"; - - TextElement text = GsonUtil.getInstance().fromJson(jsonString, TextElement.class); - assertFalse(text == null, "text object"); - assertEquals("Rechnungs-Nr.:", text.getText(), "text value"); - - } - -} diff --git a/pdf/src/test/java/de/muehlencord/shared/pdf/test/GsonSerialisation.java b/pdf/src/test/java/de/muehlencord/shared/pdf/test/GsonSerialisation.java deleted file mode 100644 index b554986..0000000 --- a/pdf/src/test/java/de/muehlencord/shared/pdf/test/GsonSerialisation.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf.test; - -import de.muehlencord.shared.pdf.ConfigurationException; -import de.muehlencord.shared.pdf.PDFDocument; -import de.muehlencord.shared.pdf.PDFFont; -import de.muehlencord.shared.pdf.PDFPaperSize; -import de.muehlencord.shared.pdf.PDFTableContent; -import de.muehlencord.shared.pdf.PDFTemplate; -import de.muehlencord.shared.pdf.TemplateException; -import freemarker.template.Configuration; -import freemarker.template.Template; -import java.io.File; -import java.io.IOException; -import java.util.LinkedList; -import java.util.List; -import org.apache.commons.io.FileUtils; -import org.junit.jupiter.api.Test; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class GsonSerialisation { - - @Test - public void testSerialisation() throws ConfigurationException, TemplateException, IOException { - - PDFDocument doc = new PDFDocument(PDFPaperSize.A4); - doc.addFont("helv12", new PDFFont("Helvetica", 12, 2)); - - PDFTableContent userList = new PDFTableContent(doc, doc.getFontByAlias("helv12"), 40F, 692F); - userList.addColumn(50, 300); - userList.addListRow("users", "user") - .setCellValue("${user.firstName}") - .setCellValue("${user.lastName}"); - doc.addContent(userList); - - // System.out.println ("*******"); - // System.out.println (doc.toJson()); - String jsonString = doc.getTemplateString(); - String fileName = System.getProperty("java.io.tmpdir") + "/users.ftlh"; - File file = new File(fileName); - FileUtils.writeStringToFile(file, jsonString, "UTF-8"); - - System.out.println("*******"); - System.out.println(jsonString); - System.out.println("*******"); - - Configuration cfg = new Configuration(Configuration.VERSION_2_3_23); - cfg.setDirectoryForTemplateLoading(new File(System.getProperty("java.io.tmpdir"))); - cfg.setDefaultEncoding("UTF-8"); - Template template = cfg.getTemplate("users.ftlh"); - PDFTemplate pdfDoc = new PDFTemplate(template); - List users = new LinkedList<>(); - users.add(new User("John", "Doe")); - users.add(new User("Jane", "Roe")); - pdfDoc.addToDatamodel("users", users); - fileName = System.getProperty("java.io.tmpdir") + "/users.pdf"; - pdfDoc.create(fileName); - - } - -} diff --git a/pdf/src/test/java/de/muehlencord/shared/pdf/test/PDFDocumentTest.java b/pdf/src/test/java/de/muehlencord/shared/pdf/test/PDFDocumentTest.java deleted file mode 100644 index fafe603..0000000 --- a/pdf/src/test/java/de/muehlencord/shared/pdf/test/PDFDocumentTest.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf.test; - -import de.muehlencord.shared.pdf.ConfigurationException; -import de.muehlencord.shared.pdf.Invoice; -import de.muehlencord.shared.pdf.InvoiceLine; -import de.muehlencord.shared.pdf.PDFDocument; -import de.muehlencord.shared.pdf.PDFFont; -import de.muehlencord.shared.pdf.PDFImageContent; -import de.muehlencord.shared.pdf.PDFPaperSize; -import de.muehlencord.shared.pdf.PDFTableContent; -import de.muehlencord.shared.pdf.PDFTemplate; -import de.muehlencord.shared.pdf.PDFTextAlignment; -import de.muehlencord.shared.pdf.PDFTextContent; -import de.muehlencord.shared.pdf.TemplateException; -import de.muehlencord.shared.pdf.util.ImageUtil; -import freemarker.template.Configuration; -import freemarker.template.Template; -import freemarker.template.TemplateExceptionHandler; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Date; -import javax.imageio.ImageIO; -import org.apache.commons.io.FileUtils; -import org.junit.jupiter.api.MethodOrderer.OrderAnnotation; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -@TestMethodOrder(OrderAnnotation.class) -public class PDFDocumentTest { - - private String jsonString = null; - - @Test - public void testToJson() throws FileNotFoundException, IOException, ConfigurationException, TemplateException, URISyntaxException { - System.out.println("testToJson"); - PDFDocument doc = new PDFDocument(PDFPaperSize.A4); - doc.addFont("bold", new PDFFont("Helvetica-Bold", 12, 2)); - doc.addFont("helv12", new PDFFont("Helvetica", 12, 2)); - - PDFTextContent addressContent = new PDFTextContent(doc, 40F, 692F, "Max Mustermann") - .addLine("Musterstraße 123") - .addLine("12345 Musterhausen"); - doc.addContent(addressContent); - - PDFImageContent logoContent = new PDFImageContent(doc, 400F, 700F, 0.6F, "${invoice.logo}"); - doc.addContent(logoContent); - - PDFTextContent informationContent = new PDFTextContent(doc, 400F, 662F); - informationContent.addLine("Anzeigenabrechnung", "bold"); - informationContent.addLine("Veronika Mühlencord", "helv12"); - informationContent.addLine("Telefon: 05257/940154", "helv12"); - informationContent.addLine("Telefax: 05257/940156", "helv12"); - informationContent.addLine(); - informationContent.addLine("Hövelhof, den ${invoice.invoiceDate?date}", "bold"); - doc.addContent(informationContent); - - PDFTableContent informationContent2 = new PDFTableContent(doc, doc.getStandardFont()); - informationContent2.addColumn(100, 100) - .addRow("Kunden-Nr", "${invoice.customerNumber}") - .addRow("Rechnungs-Nr.:", "${invoice.invoiceNumber}") - .addRow("Ausgabe: ", "Dezember") - .addRow("Rechnungsdatum:", "${invoice.invoiceDate?date}"); - doc.addContent(informationContent2); - - PDFTextContent invoiceInfoInformation = new PDFTextContent(doc, 40F, 442F, "Sehr geehrter Anzeigenkunde, ") - .addLine() - .addLine() - .addLine("Wir danken für den Auftrag und bitten um Erledigung der folgenden Anzeigenabrechnung") - .addLine(); - doc.addContent(invoiceInfoInformation); - - PDFTableContent invoiceLines = new PDFTableContent(doc, doc.getFontByAlias("bold")); - invoiceLines.addColumn(50, 300, 80, 80); - invoiceLines.addRow() - .setCellValue("Menge", "bold", 10F) - .setCellValue("Beschreibung", "bold", 10F) - .setCellValue("Einzelpreis", "bold", PDFTextAlignment.RIGHT) - .setCellValue("Summe", "bold", PDFTextAlignment.RIGHT); - invoiceLines.addRow() - .setCellValue("1000", PDFTextAlignment.RIGHT, 5F) - .setCellValue("Anzeige Hövelhofer Rundschau") - .setCellValue("10,00 €", PDFTextAlignment.RIGHT) - .setCellValue("10,00 €", PDFTextAlignment.RIGHT); - invoiceLines.addListRow("invoice.invoiceLines", "invoiceline") - .setCellValue("${invoiceline.amount}", PDFTextAlignment.RIGHT, 5F) - .setCellValue("${invoiceline.description}") - .setCellValue("${invoiceline.price}", PDFTextAlignment.RIGHT) - .setCellValue("${invoiceline.total}", PDFTextAlignment.RIGHT); - invoiceLines.addRow() - .setCellValue("2", PDFTextAlignment.RIGHT, 5F) - .setCellValue("Anzeige Hövelhofer Rundschau") - .setCellValue("10,00 €", PDFTextAlignment.RIGHT) - .setCellValue("20,00 €", PDFTextAlignment.RIGHT); - doc.addContent(invoiceLines); - - PDFTextContent test = new PDFTextContent(doc) - .addLine("Das ist ein Test"); - doc.addContent(test); - - jsonString = doc.getTemplateString(); - - String fileName = System.getProperty("java.io.tmpdir") + "/test.ftlh"; - File file = new File(fileName); - FileUtils.writeStringToFile(file, jsonString, "UTF-8"); - - // create pdf - Configuration cfg = new Configuration(Configuration.VERSION_2_3_23); - cfg.setDirectoryForTemplateLoading(new File(System.getProperty("java.io.tmpdir"))); - cfg.setDefaultEncoding("UTF-8"); - cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); - cfg.setLogTemplateExceptions(false); - - Template template = cfg.getTemplate("test.ftlh"); - PDFTemplate pdfDoc = new PDFTemplate(template); - - Invoice invoice = new Invoice(); - invoice.setInvoiceDate(new Date()); - invoice.setCustomerNumber("8755"); - invoice.setInvoiceNumber("1234567"); - invoice.addInvoiceLine(new InvoiceLine("Product 1", "10,00 €", "1", "10,00 €")); - invoice.addInvoiceLine(new InvoiceLine("Product 2", "5,00 €", "10", "50,00 €")); - invoice.addInvoiceLine(new InvoiceLine("Product 3", "100,00 €", "20", "2000,00 €")); - - URL urlLogo = PDFDocumentTest.class.getResource("logo-verkehrsverein-hoevelh.jpg"); - File imageFile = new File (urlLogo.toURI()); - BufferedImage image = ImageIO.read(imageFile); - invoice.setLogo(ImageUtil.getEncodedString(image)); - - pdfDoc.addToDatamodel("invoice", invoice); - - fileName = System.getProperty("java.io.tmpdir") + "/test.pdf"; - pdfDoc.create(fileName); - } - -} diff --git a/pdf/src/test/java/de/muehlencord/shared/pdf/test/User.java b/pdf/src/test/java/de/muehlencord/shared/pdf/test/User.java deleted file mode 100644 index 47e6e72..0000000 --- a/pdf/src/test/java/de/muehlencord/shared/pdf/test/User.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf.test; - -import com.google.gson.annotations.Expose; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class User { - - @Expose - private final String firstName; - - @Expose - private final String lastName; - - public User(String firstName, String lastName) { - this.firstName = firstName; - this.lastName = lastName; - } - - public String getFirstName() { - return firstName; - } - - public String getLastName() { - return lastName; - } - - - -} diff --git a/pdf/src/test/java/de/muehlencord/shared/pdf/util/ImageUtilTest.java b/pdf/src/test/java/de/muehlencord/shared/pdf/util/ImageUtilTest.java deleted file mode 100644 index f1a85d0..0000000 --- a/pdf/src/test/java/de/muehlencord/shared/pdf/util/ImageUtilTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.muehlencord.shared.pdf.util; - -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import javax.imageio.ImageIO; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class ImageUtilTest { - - public ImageUtilTest() { - } - - @Test - public void testFromBase64() throws IOException { - System.out.println ("testFromFile"); - // 208x123 - // String base64CodedString = "iVBORw0KGgoAAAANSUhEUgAAANAAAAB7CAYAAAAFfw5ZAAAgkElEQVR42u2dB3wdxZ3HbUIuXEg5wkEad0eSu3AhFzgS0i4c5FJIjKkxJUAAU0yzMSYYDKYZDHJvuFe5V7khV7nbcpd7t2xsy5Z7katsWdbcfOe9fW92376++9Tm7898JFlPu7Oz85v519/UEUaMGElZ6pghMGLEAMiIEQMgI0YMgIwYMQAyYsSIAZARIwZARowYABkxYgBkxIgRAyAjRgyAjBgxADJixADIiBEDICNGjBgAGTFiAGTEiAGQESO1CkBnz5eJCflbxdhFWxJuk5ZsE3PW7harCg+IoiOnxLkLF8Ul+S9d4ToTF28TY+Q9aFNWFIqL5eWunz14/ExSfU6lHT9zLuK+izYWpXw9xm3uut1i/e5D4mjJWVF+6ZLnL5b3cPrsBbF8W7HoObVAvNRjuvjz+6PFr5oNET9tmi1+0Wyw+P1bI0XDTlNEmzFLRF7B5+LA8dMpv71L8hlmyGtYz8j7O3uhzLeJu3DDnqTGfLyc29MLdoolW/aJwv3HxYkzparPngFo/a5D4tuPfyq+cHfbhNsX72knvvxAB3H1X7uKG57vK+77cJz4eFS+fLgicab0gqioqEipU9v2HRP/+lTP0H1ubjJQHDpxxvWzny3brvqQTL+Taf/0UGeRv2mv7Z4Xyy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n30AWKvBoTVhM3Go8LsqUqHQF/j4jguN+JiNQ9lXS3313teED09ZBFN9wkjdzx321ZJrIJmYbF9rQMlOm8KL4iL3FTX6zQbl/KwOmFb1QwB32SvA3JN4RBcembkehjjqSsP0YtspDH3ad6HxJ3VBsSp1jjEhYvPMQZH6VzPxe3X+gSGci0ajPM5mFDrB1yfxQPz+2eVt36YgVz4xTdiY5IrI2MWYY43/v2Lf63BGUfar8KQsiTtO5FOZeUPJWhkNcSMqkZcbDbCnUYjzohOyqzx/nzluUo5bYJH05FVS1db+Z6vKD8HIBsp763wb1tgLx7o2AH2gpipnPg0uFEx/jCHYJmvpVWQSJ0UDiJQ1b2xbBQgzLDIxGs1JhR1Am54GQVyXVlVCM2GlG1AZGIG3VUWYDOTWU1cgztYvbaieuPv+bpzWvZteZuvC3Om9Oi5TC2KupApfd/ATiw1sgia51dQVEonYMO46G9BQCQck0jJQpy6eB2/6T+cu1Vwn45hzJrUprYKvS9263hytvCFnRa+Vn5Hz1108xGu+Uzd3MyAmAExNzMgZkDMzQyIGRBz+zO1/wOXXMEGXM2/6AAAAABJRU5ErkJg"; - // 208x123, transparent background - // String base64CodedString ="iVBORw0KGgoAAAANSUhEUgAAANAAAAB7CAYAAAAFfw5ZAAAUOElEQVR42u2dB1xU1/LH15pojEk05ZO8JH/zSTHv855pL9UkalRir6hJTKLJi5pYX2KPINIERBAsiAXFThHsitIsCGJBmlJsgLQrCFIVFJz/zLCsu8sCS8wzD5lvPucTvbv33rPX+d2Zc+6cuSqVIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiCIAiC0OQJjUmJG++6P3eK20FlyoqqNhnbr+5BymK/SOVg1GXlak6hUn6nQgGAGu1ORaXiH56kjF92QElVCnjbXWzH4tOUn5ceULSPa6hNXhHALS7lGu9bVl6hTFqO290MffegMm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KBQCAQCASZgf8DlXKsjIay5OsAAAAASUVORK5C"; - BufferedImage img = ImageUtil.getImageFromEncodedString(base64CodedString); - File outputfile = new File("c:/temp/image.png"); - ImageIO.write(img, "png", outputfile); - } - - @Test - @Disabled - public void testFromFile() throws IOException { - System.out.println ("testFromFile"); - BufferedImage img = ImageIO.read(new File ("c:/temp/dn_logo_smartteller_transparent.png")); - System.out.println (ImageUtil.getEncodedString(img)); - } - - -} diff --git a/pdf/src/test/resources/de/muehlencord/shared/pdf/logo-verkehrsverein-hoevelh.jpg b/pdf/src/test/resources/de/muehlencord/shared/pdf/logo-verkehrsverein-hoevelh.jpg deleted file mode 100644 index ee9295c8ff2b2f9554b575e7fc27a3301cb40229..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5041 zcma)8byO5ym>qHe1sr;WnE{59p&N!!knWH!NkM8zfdM2HB?oB)r5h2YMM^rPheigZ zTaXeKx6bZwchA}T{(0Yb-?{Ie7vFo=*y|<09W^CYB>)~C0DyPX0N1mC2mmQDkm?Q< z6%~k@j+T}d3}s|spk;u9VN5Ux6ary}K^fqzA}nwgPG$yrxC{&XJp@0$5Hqu=gfOo- z7ry`kkBp3rf}Dc!&K*Wxc4iJfUS3h&8}Rdr^YY#V{Ji`^HyQrFx&Oew2RH0rT(<&1 zBmhT14FMhqfDghW0O4JC0vK-$;uHL}`kx>qA|M9h|0VC=0pQ~i;1d!MlHdbL{|>;z zCjbzFs91=I1s_oBK4wLQCIV@MCmr z`5Or$LgE`v{Kf`89v%@P2{8cpZ?oTUAVMl?7C~L22agk3g;1f@Z6o_Mw0ipQf56#< z<-;%s*E4|I1UH^R1R#JMU|R(LxegiLeJ&!vJDUGz_gS{RBHs#kaWC5v8SR@lhW2fD z{pio{$C8?PA5bpa76cQN?5&z01DG-|OhL~o9J`w?xL`T_q!NOmtGOl3iOZKW*8oaZ z-1DO!e#W~7h6+nHb$gZiz&x1 zdONq9J<7*Tr&-ukerFuN=o&y}B$xbb>4HO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>Vsra5rUZ?BHQR5$FpqLsHjk z?Ctl@9SMNY%*!V{H9jsm2G+Q_rei4Mt;TBr)SvicK*Wpf%Tr$}ZMXA?9?-aTW zq2QJ<+i|<>1=SyG`k+Rf%I<^N0@7qEl-fOhru2rc>Ah!f-{w^l+1y|8wN3SG$tOAu zRnpuTTJPY@4*s!a3#o{$)VnvGp{aQ?d+IDIxGp$VS8%s=T-i5|k?4%PyUx>#G7qr}FB26a>16^sd zPZ^|RRY-p1VDWn{!80KHQ#;Q_c-)W#>{$_y={yfY#6AKJdcIxH=nuK-+0q~#BgHv+ z3Te0UF08sulcxI`j$;`?CtgJjI~r75uT!R;;j+HC2GE!*S1EZXs3m6CGp~J^9gVd! zF>u_11BqAF)s=-5=wJ-v0|UWeB$^BJP(JO!Dj$ayd%t0wFnj07CPvyxDvi=E1+3%Y z$5~uRSQ=6AX^P67`p1ZQ*N8^wNMrbU_&7{g&s0ax*j_Xqj&0v!?KDZxK`#I+ZV!Op zW522V>+amT+0eJ;**v;QoDRNx%1xZEwS!8aJB1*B^=R&n)SaailRSC0Oet&=)5_X= z2^g7m+7v_Wlz;q-!*3PMLbKn%#y@*d715G+wLfVoEhxQ0Fn~%0HQ5JJ+a=5m6G^Ns axJa4p>hzNuBy){ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pom.xml b/pom.xml index fedc3d1..04f2060 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,6 @@ limitations under the License. network util jeeutil - pdf shiro-faces poi-util db @@ -202,18 +201,7 @@ limitations under the License. hibernate-core 5.3.10.Final jar - - - - org.apache.pdfbox - pdfbox - 2.0.16 - - - org.freemarker - freemarker - 2.3.29 - + org.primefaces primefaces