]> _ Git - cubeextranet.git/blob
63f4fcaaef0e32f6520c6080da976bc8c2afda23
[cubeextranet.git] /
1 /*\r
2  * Licensed to the Apache Software Foundation (ASF) under one or more\r
3  * contributor license agreements.  See the NOTICE file distributed with\r
4  * this work for additional information regarding copyright ownership.\r
5  * The ASF licenses this file to You under the Apache License, Version 2.0\r
6  * (the "License"); you may not use this file except in compliance with\r
7  * the License.  You may obtain a copy of the License at\r
8  *\r
9  *      http://www.apache.org/licenses/LICENSE-2.0\r
10  *\r
11  * Unless required by applicable law or agreed to in writing, software\r
12  * distributed under the License is distributed on an "AS IS" BASIS,\r
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14  * See the License for the specific language governing permissions and\r
15  * limitations under the License.\r
16  */\r
17 package org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure;\r
18 \r
19 import org.apache.pdfbox.cos.COSBase;\r
20 import org.apache.pdfbox.cos.COSDictionary;\r
21 import org.apache.pdfbox.pdmodel.common.COSObjectable;\r
22 \r
23 /**\r
24  * The MarkInfo provides additional information relevant to specialized\r
25  * uses of structured documents.\r
26  *\r
27  * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>\r
28  * @version $Revision: 1.4 $\r
29  */\r
30 public class PDMarkInfo implements COSObjectable\r
31 {\r
32     private COSDictionary dictionary;\r
33 \r
34     /**\r
35      * Default Constructor.\r
36      *\r
37      */\r
38     public PDMarkInfo()\r
39     {\r
40         dictionary = new COSDictionary();\r
41     }\r
42 \r
43     /**\r
44      * Constructor for an existing MarkInfo element.\r
45      *\r
46      * @param dic The existing dictionary.\r
47      */\r
48     public PDMarkInfo( COSDictionary dic )\r
49     {\r
50         dictionary = dic;\r
51     }\r
52 \r
53     /**\r
54      * Convert this standard java object to a COS object.\r
55      *\r
56      * @return The cos object that matches this Java object.\r
57      */\r
58     public COSBase getCOSObject()\r
59     {\r
60         return dictionary;\r
61     }\r
62 \r
63     /**\r
64      * Convert this standard java object to a COS object.\r
65      *\r
66      * @return The cos object that matches this Java object.\r
67      */\r
68     public COSDictionary getDictionary()\r
69     {\r
70         return dictionary;\r
71     }\r
72 \r
73     /**\r
74      * Tells if this is a tagged PDF.\r
75      *\r
76      * @return true If this is a tagged PDF.\r
77      */\r
78     public boolean isMarked()\r
79     {\r
80         return dictionary.getBoolean( "Marked", false );\r
81     }\r
82 \r
83     /**\r
84      * Set if this is a tagged PDF.\r
85      *\r
86      * @param value The new marked value.\r
87      */\r
88     public void setMarked( boolean value )\r
89     {\r
90         dictionary.setBoolean( "Marked", value );\r
91     }\r
92 \r
93     /**\r
94      * Tells if structure elements use user properties.\r
95      *\r
96      * @return A boolean telling if the structure elements use user properties.\r
97      */\r
98     public boolean usesUserProperties()\r
99     {\r
100         return dictionary.getBoolean( "UserProperties", false );\r
101     }\r
102 \r
103     /**\r
104      * Set if the structure elements contain user properties.\r
105      *\r
106      * @param userProps The new value for this property.\r
107      */\r
108     public void setUserProperties( boolean userProps )\r
109     {\r
110         dictionary.setBoolean( "UserProperties", userProps );\r
111     }\r
112 \r
113     /**\r
114      * Tells if this PDF contain 'suspect' tags.  See PDF Reference 1.6\r
115      * section 10.6 "Logical Structure" for more information about this property.\r
116      *\r
117      * @return true if the suspect flag has been set.\r
118      */\r
119     public boolean isSuspect()\r
120     {\r
121         return dictionary.getBoolean( "Suspects", false );\r
122     }\r
123 \r
124     /**\r
125      * Set the value of the suspects property.  See PDF Reference 1.6\r
126      * section 10.6 "Logical Structure" for more information about this\r
127      * property.\r
128      *\r
129      * @param suspect The new "Suspects" value.\r
130      */\r
131     public void setSuspect( boolean suspect )\r
132     {\r
133         dictionary.setBoolean( "Suspects", false );\r
134     }\r
135 }\r