11/*
22 This file is part of the iText (R) project.
33 Copyright (c) 1998-2021 iText Group NV
4- Authors: Bruno Lowagie, Paulo Soares, et al .
5-
4+ Authors: iText Software .
5+
66 This program is free software; you can redistribute it and/or modify
77 it under the terms of the GNU Affero General Public License version 3
88 as published by the Free Software Foundation with the addition of the
99 following permission added to Section 15 as permitted in Section 7(a):
1010 FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
1111 ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT
1212 OF THIRD PARTY RIGHTS
13-
13+
1414 This program is distributed in the hope that it will be useful, but
1515 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1616 or FITNESS FOR A PARTICULAR PURPOSE.
@@ -20,41 +20,80 @@ This file is part of the iText (R) project.
2020 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
2121 Boston, MA, 02110-1301 USA, or download the license from the following URL:
2222 http://itextpdf.com/terms-of-use/
23-
23+
2424 The interactive user interfaces in modified source and object code versions
2525 of this program must display Appropriate Legal Notices, as required under
2626 Section 5 of the GNU Affero General Public License.
27-
27+
2828 In accordance with Section 7(b) of the GNU Affero General Public License,
2929 a covered work must retain the producer line in every PDF that is created
3030 or manipulated using iText.
31-
31+
3232 You can be released from the requirements of the license by purchasing
3333 a commercial license. Buying such a license is mandatory as soon as you
3434 develop commercial activities involving the iText software without
3535 disclosing the source code of your own applications.
3636 These activities include: offering paid services to customers as an ASP,
3737 serving PDFs on the fly in a web application, shipping iText with a closed
3838 source product.
39-
39+
4040 For more information, please contact iText Software Corp. at this
41414242 */
43-
4443package com .itextpdf .pdfcleanup ;
4544
45+ import com .itextpdf .commons .actions .contexts .IMetaInfo ;
46+
4647/**
47- * Product info about this iText add-on .
48+ * Contains properties for {@link PdfCleanUpTool} operations .
4849 */
49- // TODO refactor? move to local fields in order to hide it?
50- public class PdfCleanupProductInfo {
51-
52- /** The product name. */
53- public static final String PRODUCT_NAME = "pdfSweep" ;
54-
55- /** The major version number. */
56- public static final int MAJOR_VERSION = 2 ;
57-
58- /** The minor version number. */
59- public static final int MINOR_VERSION = 0 ;
50+ public class CleanUpProperties {
51+
52+ private IMetaInfo metaInfo ;
53+ private boolean processAnnotations ;
54+
55+ /**
56+ * Creates default CleanUpProperties instance.
57+ */
58+ public CleanUpProperties () {
59+ processAnnotations = true ;
60+ }
61+
62+ /**
63+ * Returns metaInfo property.
64+ *
65+ * @return metaInfo property
66+ */
67+ IMetaInfo getMetaInfo () {
68+ return metaInfo ;
69+ }
70+
71+ /**
72+ * Sets additional meta info.
73+ *
74+ * @param metaInfo the meta info to set
75+ */
76+ public void setMetaInfo (IMetaInfo metaInfo ) {
77+ this .metaInfo = metaInfo ;
78+ }
79+
80+ /**
81+ * Check if page annotations will be processed.
82+ * Default: {@code true}.
83+ *
84+ * @return {@code true} if annotations will be processed by the {@link PdfCleanUpTool}
85+ */
86+ public boolean isProcessAnnotations () {
87+ return processAnnotations ;
88+ }
89+
90+ /**
91+ * Set if page annotations will be processed.
92+ * Default processing behaviour: remove annotation if there is overlap with a redaction region.
93+ *
94+ * @param processAnnotations is page annotations will be processed
95+ */
96+ public void setProcessAnnotations (boolean processAnnotations ) {
97+ this .processAnnotations = processAnnotations ;
98+ }
6099}
0 commit comments