From 34ef8841e837cdc8fdf15393c1b7442b288eaaee Mon Sep 17 00:00:00 2001 From: Maxim Date: Mon, 25 Dec 2023 12:36:57 +0300 Subject: [PATCH] Add GFPDWatermarkAnnot --- .../verapdf/gf/model/impl/pd/GFPDAnnot.java | 3 ++ .../pd/annotations/GFPDWatermarkAnnot.java | 40 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 validation-model/src/main/java/org/verapdf/gf/model/impl/pd/annotations/GFPDWatermarkAnnot.java diff --git a/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDAnnot.java b/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDAnnot.java index f85d753c2..6286d4c19 100644 --- a/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDAnnot.java +++ b/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDAnnot.java @@ -92,6 +92,7 @@ public class GFPDAnnot extends GFPDObject implements PDAnnot { public static final String SQUIGGLY = "Squiggly"; public static final String TEXT = "Text"; public static final String TRAP_NET = "TrapNet"; + public static final String WATERMARK = "Watermark"; public static final String UNDERLINE = "Underline"; public static final String WIDGET = "Widget"; @@ -472,6 +473,8 @@ public static GFPDAnnot createAnnot(PDAnnotation annot, PDResourcesHandler pageR return new GFPDRubberStampAnnot(annot, pageResources, page); case TRAP_NET: return new GFPDTrapNetAnnot(annot, pageResources, page); + case WATERMARK: + return new GFPDWatermarkAnnot(annot, pageResources, page); case WIDGET: return new GFPDWidgetAnnot((PDWidgetAnnotation) annot, pageResources, page); case CARET: diff --git a/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/annotations/GFPDWatermarkAnnot.java b/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/annotations/GFPDWatermarkAnnot.java new file mode 100644 index 000000000..5663cf7af --- /dev/null +++ b/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/annotations/GFPDWatermarkAnnot.java @@ -0,0 +1,40 @@ +/** + * This file is part of veraPDF Validation, a module of the veraPDF project. + * Copyright (c) 2015, veraPDF Consortium + * All rights reserved. + * + * veraPDF Validation is free software: you can redistribute it and/or modify + * it under the terms of either: + * + * The GNU General public license GPLv3+. + * You should have received a copy of the GNU General Public License + * along with veraPDF Validation as the LICENSE.GPL file in the root of the source + * tree. If not, see http://www.gnu.org/licenses/ or + * https://www.gnu.org/licenses/gpl-3.0.en.html. + * + * The Mozilla Public License MPLv2+. + * You should have received a copy of the Mozilla Public License along with + * veraPDF Validation as the LICENSE.MPL file in the root of the source tree. + * If a copy of the MPL was not distributed with this file, you can obtain one at + * http://mozilla.org/MPL/2.0/. + */ +package org.verapdf.gf.model.impl.pd.annotations; + +import org.verapdf.gf.model.impl.pd.GFPDAnnot; +import org.verapdf.gf.model.impl.pd.util.PDResourcesHandler; +import org.verapdf.model.pdlayer.PDWatermarkAnnot; +import org.verapdf.pd.PDAnnotation; +import org.verapdf.pd.PDPage; + +/** + * @author Maxim Plushchov + */ +public class GFPDWatermarkAnnot extends GFPDAnnot implements PDWatermarkAnnot { + + public static final String WATERMARK_ANNOTATION_TYPE = "PDWatermarkAnnot"; + + public GFPDWatermarkAnnot(PDAnnotation annot, PDResourcesHandler pageResources, PDPage page) { + super(annot, pageResources, page, WATERMARK_ANNOTATION_TYPE); + } + +}