Class PdfName

java.lang.Object
org.openpdf.text.pdf.PdfObject
org.openpdf.text.pdf.PdfName
All Implemented Interfaces:
Comparable<PdfName>

public class PdfName extends PdfObject implements Comparable<PdfName>
PdfName is an object that can be used as a name in a PDF-file.

A name, like a string, is a sequence of characters. It must begin with a slash followed by a sequence of ASCII characters in the range 32 through 136 except %, (, ), [, ], <, >, {, }, / and #. Any character except 0x00 may be included in a name by writing its two character hex code, preceded by #. The maximum number of characters in a name is 127.
This object is described in the 'Portable Document Format Reference Manual version 1.7' section 3.2.4 (page 56-58).

See Also:
  • Field Details

    • A

      public static final PdfName A
      (Optional) An action that shall be performed when the annotation is activated.
    • AA

      public static final PdfName AA
      (Optional) An additional-actions dictionary defining the field's / annotations's behaviour in response to various trigger events. This entry has exactly the same meaning as the AA entry in an annotation dictionary.
    • AC

      public static final PdfName AC
      A name
    • AF

      public static final PdfName AF
      (Optional; PDF 2.0) An array of one or more file specification dictionaries which denote the associated files for this annotation.
    • ANNOTS

      public static final PdfName ANNOTS
      A name
    • AP

      public static final PdfName AP
      (Optional) An appearance dictionary specifying how the annotation shall be presented visually on the page. A PDF writer shall include an appearance dictionary when writing or updating an annotation dictionary except for the two cases listed below. Every annotation (including those whose Subtype value is Widget, as used for form fields), except for the two cases listed below, shall have at least one appearance dictionary. Exclusions:
      • Annotations where the value of the Rect key consists of an array where the value at index 1 is equal to the value at index 3 or the value at index 2 is equal to the value at index 4
      • Annotations whose Subtype value is Popup, Projection or Link.
    • ARTBOX

      public static final PdfName ARTBOX
      A name
    • ASCENT

      public static final PdfName ASCENT
      A name
    • AS

      public static final PdfName AS
      (Required if the appearance dictionary AP contains one or more subdictionaries) The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary.
    • AUTHOR

      public static final PdfName AUTHOR
      A name
    • B

      public static final PdfName B
      A name
    • BASEFONT

      public static final PdfName BASEFONT
      A name
    • BBOX

      public static final PdfName BBOX
      A name
    • BC

      public static final PdfName BC
      A name
    • BITSPERCOMPONENT

      public static final PdfName BITSPERCOMPONENT
      A name
    • BLACKIS1

      public static final PdfName BLACKIS1
      A name
    • BLEEDBOX

      public static final PdfName BLEEDBOX
      A name
    • BOX

      public static final PdfName BOX
      A name
    • BS

      public static final PdfName BS
      A name
    • C

      public static final PdfName C
      (Optional) An array of numbers in the range 0.0 to 1.0, representing a colour used for the following purposes:
      • The background of the annotation's icon when closed
      • The title bar of the annotation's popup window
      • The border of a link annotation

      The number of array elements determines the colour space in which the colour shall be defined: 0=No colour; transparent 1=DeviceGray 3=DeviceRGB 4=DeviceCMYK

    • C0

      public static final PdfName C0
      A name
    • C1

      public static final PdfName C1
      A name
    • CA

      public static final PdfName CA
      (Optional; PDF 2.0) When regenerating the annotation's appearance stream, this is the opacity value that shall be used for stroking all visiblea elements of the annotation in its closed state, including its background and border, but not the popup window that appears when the annotation is opened. If a ca entry is not present in this dictionary, then the value of this CA entry shall also be used for nonstroking operations as well.

      Default Value: 1.0

      The specified value shall not be used if the annotation has an appearance stream; in that case, the appearance stream shall specify any transparency.

    • ca

      public static final PdfName ca
      (Optional; PDF 2.0) When regenerating the annotation's appearance stream, this is the opacity value that shall be used for all nonstroking operations on all visible elements of the annotation in its closed state (including its background and border) but not the popup window that appears when the annotation is opened. Default value: 1.0 The specified value shall not be used if the annotation has an appearance stream in that case, the appearance stream shall specify any transparency.
    • CAPHEIGHT

      public static final PdfName CAPHEIGHT
      A name
    • CATALOG

      public static final PdfName CATALOG
      A name
    • CCITTFAXDECODE

      public static final PdfName CCITTFAXDECODE
      A name
    • CI

      public static final PdfName CI
      A name
    • CMD

      public static final PdfName CMD
      A name.
      Since:
      2.1.6
    • COLORSPACE

      public static final PdfName COLORSPACE
      A name
    • COLUMNS

      public static final PdfName COLUMNS
      A name
    • CONTENT

      public static final PdfName CONTENT
      A name
    • CONTENTS

      public static final PdfName CONTENTS
      Used in several places:
      • 1) Annotations: (Optional) Text that shall be displayed for the annotation or, if this type of annotation does not display text, an alternative description of the annotation's contents in human-readable form. In either case, this text is useful when extracting the document's contents in support of accessibility to users with disabilities or for other purposes. Might be different for each annotation type.
      • 2) Part of the signature dictionary. The signature value. The value is a hexadecimal string representing the value of the byte range digest. (Required)
    • COUNT

      public static final PdfName COUNT
      A name
    • COURIER

      public static final PdfName COURIER
      A name of a base 14 type 1 font
    • COURIER_BOLD

      public static final PdfName COURIER_BOLD
      A name of a base 14 type 1 font
    • COURIER_OBLIQUE

      public static final PdfName COURIER_OBLIQUE
      A name of a base 14 type 1 font
    • COURIER_BOLDOBLIQUE

      public static final PdfName COURIER_BOLDOBLIQUE
      A name of a base 14 type 1 font
    • CREATIONDATE

      public static final PdfName CREATIONDATE
      A name
    • CREATOR

      public static final PdfName CREATOR
      A name
    • CROPBOX

      public static final PdfName CROPBOX
      A name
    • CS

      public static final PdfName CS
      A name
    • D

      public static final PdfName D
      A name
    • DATE

      public static final PdfName DATE
      Part of the Build Data Dictionary. The software module build date.
    • DC

      public static final PdfName DC
      A name
    • DECODE

      public static final PdfName DECODE
      A name
    • DECODEPARMS

      public static final PdfName DECODEPARMS
      A name
    • DEFAULT

      public static final PdfName DEFAULT
      A name
      Since:
      2.1.6
    • DESCENT

      public static final PdfName DESCENT
      A name
    • DEST

      public static final PdfName DEST
      A name
    • DEVICEGRAY

      public static final PdfName DEVICEGRAY
      A name
    • DEVICERGB

      public static final PdfName DEVICERGB
      A name
    • DEVICECMYK

      public static final PdfName DEVICECMYK
      A name
    • DIFFERENCES

      public static final PdfName DIFFERENCES
      A name
    • DL

      public static final PdfName DL
      A name
    • DOCUMENT

      public static final PdfName DOCUMENT
      A name.
      Since:
      2.1.6
    • DP

      public static final PdfName DP
      A name
    • DR

      public static final PdfName DR
      A name
    • DS

      public static final PdfName DS
      (Optional) A default style string; described in the PDF Annex M.
    • E

      public static final PdfName E
      Entry in a structure element dictionary: The expanded form of an abbreviation or an acronym.

      OR

      Entry in an annotation’s additional-actions dictionary: An action that shall be performed when the cursor enters theannotation’s active area.

      OR

      Entry in a collection field dictionary: A flag indicating whether the interactive PDF processor should provide support for editing the field value.

      OR more...

    • EF

      public static final PdfName EF
      A name
    • EMBEDDED

      public static final PdfName EMBEDDED
      A name
      Since:
      2.1.6
    • ENCODEDBYTEALIGN

      public static final PdfName ENCODEDBYTEALIGN
      A name
    • ENCODING

      public static final PdfName ENCODING
      A name
    • ENCRYPT

      public static final PdfName ENCRYPT
      A name
    • ENDOFBLOCK

      public static final PdfName ENDOFBLOCK
      A name
    • ENDOFLINE

      public static final PdfName ENDOFLINE
      A name
    • EXTENSIONS

      public static final PdfName EXTENSIONS
      A name
      Since:
      2.1.6
    • EXTGSTATE

      public static final PdfName EXTGSTATE
      A name
    • F

      public static final PdfName F
      (Optional) A set of flags specifying various characteristics of the annotation Default value: 0.
    • FILEID

      public static final PdfName FILEID
      A name
    • FILTER

      public static final PdfName FILTER
      A name
    • FIRST

      public static final PdfName FIRST
      A name
    • FIRSTCHAR

      public static final PdfName FIRSTCHAR
      A name
    • FIRSTPAGE

      public static final PdfName FIRSTPAGE
      A name
    • FLAGS

      public static final PdfName FLAGS
      A name
    • FLATEDECODE

      public static final PdfName FLATEDECODE
      A name
    • FONT

      public static final PdfName FONT
      A name
    • FONTBBOX

      public static final PdfName FONTBBOX
      A name
    • FONTDESCRIPTOR

      public static final PdfName FONTDESCRIPTOR
      A name
    • FONTFILE

      public static final PdfName FONTFILE
      A name
    • FONTNAME

      public static final PdfName FONTNAME
      (Required) The PostScript name of the font. This name shall be the same as the value of BaseFont in the font or CIDFont dictionary that refers to this font descriptor.
    • FORM

      public static final PdfName FORM
      A name
    • FORMTYPE

      public static final PdfName FORMTYPE
      A name
    • FS

      public static final PdfName FS
      A name
    • GOTO

      public static final PdfName GOTO
      A name of an attribute.
    • GOTOR

      public static final PdfName GOTOR
      A name of an attribute.
    • GROUP

      public static final PdfName GROUP
      A name of an attribute.
    • H

      public static final PdfName H
      Optional) The annotation's highlighting mode, the visual effect that shall be used when the mouse button is pressed or held down inside its active area:
      • N (None) No highlighting.
      • I (Invert) Invert the colours used to display the contents of the annotation rectangle.
      • O (Outline) Stroke the colours used to display the annotation border.
      • P (Push) Display the annotation's down appearance, if any. If no down appearance is defined, the contents of the annotation rectangle shall be offset to appear as if it were beingpushed below the surface of the page.
      • T (Toggle) Same as P (which is preferred).
      A highlighting mode other than P shall override any down appearance defined for the annotation. Default value: I.
    • HEIGHT

      public static final PdfName HEIGHT
      A name of an attribute.
    • HELVETICA

      public static final PdfName HELVETICA
      A name of a base 14 type 1 font
    • HELVETICA_BOLD

      public static final PdfName HELVETICA_BOLD
      A name of a base 14 type 1 font
    • HELVETICA_OBLIQUE

      public static final PdfName HELVETICA_OBLIQUE
      A name of a base 14 type 1 font
    • HELVETICA_BOLDOBLIQUE

      public static final PdfName HELVETICA_BOLDOBLIQUE
      A name of a base 14 type 1 font
    • I

      public static final PdfName I
      (Sometimes required, otherwise optional) For choice fields that allow multiple selection (MultiSelect flag set), an array of integers, sorted in ascending order, representing the zero-based indices in the Opt array of the currently selected option items. This entry shall be used when two or more elements in the Opt array have different names but the same export value or when the value of the choice field is an array. If the items identified by this entry differ from those in the V entry of the field dictionary (see discussion following this Table), the V entry shall be used.
    • ID

      public static final PdfName ID
      A name
    • IDENTITY

      public static final PdfName IDENTITY
      A name
    • IF

      public static final PdfName IF
      A name
    • IMAGE

      public static final PdfName IMAGE
      A name
    • IMAGEMASK

      public static final PdfName IMAGEMASK
      A name
    • INDEX

      public static final PdfName INDEX
      A name
    • INDEXED

      public static final PdfName INDEXED
      A name
    • INFO

      public static final PdfName INFO
      A name
    • INTENT

      public static final PdfName INTENT
      A name
    • INTERPOLATE

      public static final PdfName INTERPOLATE
      A name
    • ISMAP

      public static final PdfName ISMAP
      A name
    • ITALICANGLE

      public static final PdfName ITALICANGLE
      A name
    • IX

      public static final PdfName IX
      A name
    • JAVASCRIPT

      public static final PdfName JAVASCRIPT
      A name
    • JBIG2GLOBALS

      public static final PdfName JBIG2GLOBALS
      A name
      Since:
      2.1.5
    • JS

      public static final PdfName JS
      A name
    • K

      public static final PdfName K
      A name
    • KEYWORDS

      public static final PdfName KEYWORDS
      A name
    • KIDS

      public static final PdfName KIDS
      (Sometimes required, as described) An array of indirect references to the immediate children of this field. In a non-terminal field, the Kids array shall refer to field dictionaries that are immediate descendants of this field. In a terminal field, the Kids array ordinarily shall refer to one or more separate widget annotations that are associated with this field. However, if there is only one associated widget annotation, and its contents have been merged into the field dictionary, Kids shall be omitted.
    • L

      public static final PdfName L
      A name
    • LASTCHAR

      public static final PdfName LASTCHAR
      A name
    • LASTPAGE

      public static final PdfName LASTPAGE
      A name
    • LENGTH

      public static final PdfName LENGTH
      A name
    • LI

      public static final PdfName LI
      A name
      Since:
      2.1.6
    • M

      public static final PdfName M
      (Optional) The date and time when the annotation was most recently modified. The format should be a date string (a text string containing no whitespace, of the form (D:YYYYMMDDHHmmSSOHH'mm)) but interactive PDF processors shall accept and display a string in any format.
    • MATRIX

      public static final PdfName MATRIX
      A name
    • MAC_ROMAN_ENCODING

      public static final PdfName MAC_ROMAN_ENCODING
      A name of an encoding
    • MARKED

      public static final PdfName MARKED
      A name
    • MASK

      public static final PdfName MASK
      A name
    • MEDIABOX

      public static final PdfName MEDIABOX
      A name
    • METADATA

      public static final PdfName METADATA
      A name
    • MODDATE

      public static final PdfName MODDATE
      A name
    • N

      public static final PdfName N
      A name
    • NAME

      public static final PdfName NAME
      (optional) The name of the person or authority signing the document. This value should be used only when it is not possible to extract the name from the signature.
    • NAMED

      public static final PdfName NAMED
      A name
    • NEXTPAGE

      public static final PdfName NEXTPAGE
      A name
    • O

      public static final PdfName O
      A name
    • OBJSTM

      public static final PdfName OBJSTM
      A name
    • OC

      public static final PdfName OC
      (Optional) An optional content group or optional content membership dictionary specifying the optional content properties for the annotation. Before the annotation is drawn, its visibility shall be determined based on this entry as well as the annotation flags specified in the F entry. If it is determined to be invisible, the annotation shall not be drawn.
    • OCG

      public static final PdfName OCG
      A name
    • OFF

      public static final PdfName OFF
      A name
    • ON

      public static final PdfName ON
      A name
    • op

      public static final PdfName op
      A name
    • OS

      public static final PdfName OS
      Parts of the Build Data Dictionary. Indicates the operating system, such as Win10. Currently there is no specific string format defined for the value of this attribute.
    • OUTLINES

      public static final PdfName OUTLINES
      A name
    • P

      public static final PdfName P
      (Optional) An indirect reference to the page object with which this annotation is associated. This entry shall be present in screen annotations associated with rendition actions. OR (Optional; PDF 2.0) The access permissions granted for this document. Valid values shall be 1,2,3
    • PAGE

      public static final PdfName PAGE
      A name
    • PAGES

      public static final PdfName PAGES
      A name
    • PARENT

      public static final PdfName PARENT
      (Required if this field is the child of another in the field hierarchy; absent otherwise) The field that is the immediate parent of this one (the field, if any, whose Kids array includes this field). A field can have at most one parent; that is, it can be included in the Kids array of at most one other field.
    • PATTERN

      public static final PdfName PATTERN
      A name
    • PDF

      public static final PdfName PDF
      A name
    • PI

      public static final PdfName PI
      A name.
      Since:
      2.1.6
    • PREV

      public static final PdfName PREV
      A name
    • PREVPAGE

      public static final PdfName PREVPAGE
      A name
    • PRODUCER

      public static final PdfName PRODUCER
      A name
    • PROPERTIES

      public static final PdfName PROPERTIES
      A name
    • PS

      public static final PdfName PS
      A name
    • Q

      public static final PdfName Q
      (Optional; inheritable) A code specifying the form of quadding (justification) that shall be used in displaying the text:
      • 0 Left-justified (default)
      • 1 Centered
      • 2 Right-justified
    • QUOTE

      public static final PdfName QUOTE
      A name
      Since:
      2.1.6
    • R

      public static final PdfName R
      Part of the Build Data Dictionary. The software module revision number
    • RECT

      public static final PdfName RECT
      (Required) The annotation rectangle, defining the location of the annotation on the page in default user space units.
    • RESOURCES

      public static final PdfName RESOURCES
      A name
    • RI

      public static final PdfName RI
      A name
    • ROOT

      public static final PdfName ROOT
      A name
    • ROTATE

      public static final PdfName ROTATE
      A name
    • ROWS

      public static final PdfName ROWS
      A name
    • S

      public static final PdfName S
      A name
    • SHADING

      public static final PdfName SHADING
      A name
    • SIZE

      public static final PdfName SIZE
      A name
    • SMASK

      public static final PdfName SMASK
      A name
    • STEMV

      public static final PdfName STEMV
      A name
    • SUBJECT

      public static final PdfName SUBJECT
      A name
    • SUBTYPE

      public static final PdfName SUBTYPE
      (Required) The type of annotation that this dictionary describes.
    • SW

      public static final PdfName SW
      A name
    • SYMBOL

      public static final PdfName SYMBOL
      A name of a base 14 type 1 font
    • T

      public static final PdfName T
      (Required) The partial field name.
    • TA

      public static final PdfName TA
      A name
      Since:
      2.1.6
    • TABLE

      public static final PdfName TABLE
      A name
      Since:
      2.1.6
    • TABS

      public static final PdfName TABS
      A name
      Since:
      2.1.5
    • TD

      public static final PdfName TD
      A name
      Since:
      2.1.6
    • TH

      public static final PdfName TH
      A name
      Since:
      2.1.6
    • TIMES_ROMAN

      public static final PdfName TIMES_ROMAN
      A name of a base 14 type 1 font
    • TIMES_BOLD

      public static final PdfName TIMES_BOLD
      A name of a base 14 type 1 font
    • TIMES_ITALIC

      public static final PdfName TIMES_ITALIC
      A name of a base 14 type 1 font
    • TIMES_BOLDITALIC

      public static final PdfName TIMES_BOLDITALIC
      A name of a base 14 type 1 font
    • TITLE

      public static final PdfName TITLE
      A name
    • TM

      public static final PdfName TM
      Optional) The mapping name that shall be used when exporting interactive form field data from the document.
    • TRANSPARENCY

      public static final PdfName TRANSPARENCY
      A name
    • TRIMBOX

      public static final PdfName TRIMBOX
      A name
    • TYPE

      public static final PdfName TYPE
      There are lots of Type s in the PDF specification. The following dictionaries use Type:
      • Crypt filters
      • object stream dictionary
      • cross-reference stream dictionary
      • encrypted payload dictionary
      • catalog dictionary
      • page tree node
      • page object
      • file specification dictionary
      • embedded file stream dictionary
      • collection item dictionary
      • collection subitem dictionary
      • extensions dictionary
      • developer extensions dictionary
      • graphics state parameter dictionary
      • Type 1 pattern dictionary
      • DSS dictionary
      • Type 2 pattern dictionary
      • image dictionary
      • Type 1 form dictionary
      • group attributes dictionary
      • content group dictionary
      • content membership dictionary
      • Type 1 font dictionary
      • Type 3 font dictionary
      • encoding dictionary
      • outline dictionary
      • annotation dictionaries
      • field lock dictionary
      • ...
    • TYPE1

      public static final PdfName TYPE1
      A name
    • U

      public static final PdfName U
      A name of an attribute.
    • UE

      public static final PdfName UE
      (Required if R=6 (PDF 2.0)) A 32-byte string, based on the user password, that shall be used in computing the file encryption key.
    • UR

      public static final PdfName UR
      A name
    • URI

      public static final PdfName URI
      A name
    • URL

      public static final PdfName URL
      A name
    • USERUNIT

      public static final PdfName USERUNIT
      A name
    • V

      public static final PdfName V
      (Optional; inheritable) The field value, whose format varies depending on the field type. See the descriptions of individual field types for further information.
    • V2

      public static final PdfName V2
      (Deprecated) The application shall ask the security handler for the file encryption key and shall implicitly decrypt data with7.6.3.1, "Algorithm 1: Encryption of data using the RC4 or AESalgorithms", using the RC4 algorithm.
    • VERSION

      public static final PdfName VERSION
      A name
    • W

      public static final PdfName W
      A name of an attribute.
    • WIDTH

      public static final PdfName WIDTH
      A name of an attribute.
    • WIDTHS

      public static final PdfName WIDTHS
      A name
    • WIN_ANSI_ENCODING

      public static final PdfName WIN_ANSI_ENCODING
      A name of an encoding
    • WS

      public static final PdfName WS
      A name of an encoding
    • X

      public static final PdfName X
      A name
    • XML

      public static final PdfName XML
      A name
    • XOBJECT

      public static final PdfName XOBJECT
      A name
    • XREF

      public static final PdfName XREF
      A name
    • XYZ

      public static final PdfName XYZ
      A name
    • ZAPFDINGBATS

      public static final PdfName ZAPFDINGBATS
      A name of a base 14 type 1 font
  • Constructor Details

    • PdfName

      public PdfName(String name)
      Constructs a new PdfName. The name length will be checked.
      Parameters:
      name - the new name
    • PdfName

      public PdfName(String name, boolean lengthCheck)
      Constructs a new PdfName.
      Parameters:
      name - the new name
      lengthCheck - if true check the length validity, if false the name can have any length
  • Method Details

    • encodeName

      public static byte[] encodeName(String name)
      Encodes a plain name given in the unescaped form "AB CD" into "/AB#20CD".
      Parameters:
      name - the name to encode
      Returns:
      the encoded name
      Since:
      2.1.5
    • compareTo

      public int compareTo(PdfName name)
      Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

      Specified by:
      compareTo in interface Comparable<PdfName>
      Parameters:
      name - the Object to be compared.
      Returns:
      a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
      Throws:
      ClassCastException - if the specified object's type prevents it from being compared to this Object.
    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one.
      Overrides:
      equals in class Object
      Parameters:
      obj - the reference object with which to compare.
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object.