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
9 * http://www.apache.org/licenses/LICENSE-2.0
\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
17 package org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure;
\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
24 * The MarkInfo provides additional information relevant to specialized
\r
25 * uses of structured documents.
\r
27 * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
\r
28 * @version $Revision: 1.4 $
\r
30 public class PDMarkInfo implements COSObjectable
\r
32 private COSDictionary dictionary;
\r
35 * Default Constructor.
\r
40 dictionary = new COSDictionary();
\r
44 * Constructor for an existing MarkInfo element.
\r
46 * @param dic The existing dictionary.
\r
48 public PDMarkInfo( COSDictionary dic )
\r
54 * Convert this standard java object to a COS object.
\r
56 * @return The cos object that matches this Java object.
\r
58 public COSBase getCOSObject()
\r
64 * Convert this standard java object to a COS object.
\r
66 * @return The cos object that matches this Java object.
\r
68 public COSDictionary getDictionary()
\r
74 * Tells if this is a tagged PDF.
\r
76 * @return true If this is a tagged PDF.
\r
78 public boolean isMarked()
\r
80 return dictionary.getBoolean( "Marked", false );
\r
84 * Set if this is a tagged PDF.
\r
86 * @param value The new marked value.
\r
88 public void setMarked( boolean value )
\r
90 dictionary.setBoolean( "Marked", value );
\r
94 * Tells if structure elements use user properties.
\r
96 * @return A boolean telling if the structure elements use user properties.
\r
98 public boolean usesUserProperties()
\r
100 return dictionary.getBoolean( "UserProperties", false );
\r
104 * Set if the structure elements contain user properties.
\r
106 * @param userProps The new value for this property.
\r
108 public void setUserProperties( boolean userProps )
\r
110 dictionary.setBoolean( "UserProperties", userProps );
\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
117 * @return true if the suspect flag has been set.
\r
119 public boolean isSuspect()
\r
121 return dictionary.getBoolean( "Suspects", false );
\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
129 * @param suspect The new "Suspects" value.
\r
131 public void setSuspect( boolean suspect )
\r
133 dictionary.setBoolean( "Suspects", false );
\r