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.interactive.annotation;
\r
19 import org.apache.pdfbox.cos.COSDictionary;
\r
20 import org.apache.pdfbox.cos.COSName;
\r
23 * This is the class that represents a rubber stamp annotation.
\r
24 * Introduced in PDF 1.3 specification
\r
27 * @version $Revision: 1.2 $
\r
29 public class PDAnnotationRubberStamp extends PDAnnotationMarkup
\r
33 * The various values of the rubber stamp as defined in
\r
34 * the PDF 1.6 reference Table 8.28
\r
38 * Constant for the name of a rubber stamp.
\r
40 public static final String NAME_APPROVED = "Approved";
\r
42 * Constant for the name of a rubber stamp.
\r
44 public static final String NAME_EXPERIMENTAL = "Experimental";
\r
46 * Constant for the name of a rubber stamp.
\r
48 public static final String NAME_NOT_APPROVED = "NotApproved";
\r
50 * Constant for the name of a rubber stamp.
\r
52 public static final String NAME_AS_IS = "AsIs";
\r
54 * Constant for the name of a rubber stamp.
\r
56 public static final String NAME_EXPIRED = "Expired";
\r
58 * Constant for the name of a rubber stamp.
\r
60 public static final String NAME_NOT_FOR_PUBLIC_RELEASE = "NotForPublicRelease";
\r
62 * Constant for the name of a rubber stamp.
\r
64 public static final String NAME_FOR_PUBLIC_RELEASE = "ForPublicRelease";
\r
66 * Constant for the name of a rubber stamp.
\r
68 public static final String NAME_DRAFT = "Draft";
\r
70 * Constant for the name of a rubber stamp.
\r
72 public static final String NAME_FOR_COMMENT = "ForComment";
\r
74 * Constant for the name of a rubber stamp.
\r
76 public static final String NAME_TOP_SECRET = "TopSecret";
\r
78 * Constant for the name of a rubber stamp.
\r
80 public static final String NAME_DEPARTMENTAL = "Departmental";
\r
82 * Constant for the name of a rubber stamp.
\r
84 public static final String NAME_CONFIDENTIAL = "Confidential";
\r
86 * Constant for the name of a rubber stamp.
\r
88 public static final String NAME_FINAL = "Final";
\r
90 * Constant for the name of a rubber stamp.
\r
92 public static final String NAME_SOLD = "Sold";
\r
95 * The type of annotation.
\r
97 public static final String SUB_TYPE = "Stamp";
\r
102 public PDAnnotationRubberStamp()
\r
105 getDictionary().setItem( COSName.SUBTYPE, COSName.getPDFName( SUB_TYPE ) );
\r
109 * Creates a Rubber Stamp annotation from a COSDictionary, expected to be
\r
110 * a correct object definition.
\r
112 * @param field the PDF objet to represent as a field.
\r
114 public PDAnnotationRubberStamp(COSDictionary field)
\r
120 * This will set the name (and hence appearance, AP taking precedence)
\r
121 * For this annotation. See the NAME_XXX constants for valid values.
\r
123 * @param name The name of the rubber stamp.
\r
125 public void setName( String name )
\r
127 getDictionary().setName(COSName.NAME, name);
\r
131 * This will retrieve the name (and hence appearance, AP taking precedence)
\r
132 * For this annotation. The default is DRAFT.
\r
134 * @return The name of this rubber stamp, see the NAME_XXX constants.
\r
136 public String getName()
\r
138 return getDictionary().getNameAsString(COSName.NAME, NAME_DRAFT);
\r