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