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