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