KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lowagie > text > pdf > PdfName


1 /*
2  * $Id: PdfName.java 2747 2007-05-11 14:27:03Z psoares33 $
3  * $Name$
4  *
5  * Copyright 1999-2006 Bruno Lowagie
6  *
7  * The contents of this file are subject to the Mozilla Public License Version 1.1
8  * (the "License"); you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
10  *
11  * Software distributed under the License is distributed on an "AS IS" basis,
12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13  * for the specific language governing rights and limitations under the License.
14  *
15  * The Original Code is 'iText, a free JAVA-PDF library'.
16  *
17  * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by
18  * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie.
19  * All Rights Reserved.
20  * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer
21  * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved.
22  *
23  * Contributor(s): all the names of the contributors are added in the source code
24  * where applicable.
25  *
26  * Alternatively, the contents of this file may be used under the terms of the
27  * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the
28  * provisions of LGPL are applicable instead of those above. If you wish to
29  * allow use of your version of this file only under the terms of the LGPL
30  * License and not to allow others to use your version of this file under
31  * the MPL, indicate your decision by deleting the provisions above and
32  * replace them with the notice and other provisions required by the LGPL.
33  * If you do not delete the provisions above, a recipient may use your version
34  * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE.
35  *
36  * This library is free software; you can redistribute it and/or modify it
37  * under the terms of the MPL as stated above or under the terms of the GNU
38  * Library General Public License as published by the Free Software Foundation;
39  * either version 2 of the License, or any later version.
40  *
41  * This library is distributed in the hope that it will be useful, but WITHOUT
42  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
43  * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more
44  * details.
45  *
46  * If you didn't download this code from the following link, you should check if
47  * you aren't using an obsolete version:
48  * http://www.lowagie.com/iText/
49  */

50
51 package com.lowagie.text.pdf;
52
53 /**
54  * <CODE>PdfName</CODE> is an object that can be used as a name in a PDF-file.
55  * <P>
56  * A name, like a string, is a sequence of characters. It must begin with a slash
57  * followed by a sequence of ASCII characters in the range 32 through 136 except
58  * %, (, ), [, ], &lt;, &gt;, {, }, / and #. Any character except 0x00 may be included
59  * in a name by writing its twocharacter hex code, preceded by #. The maximum number
60  * of characters in a name is 127.<BR>
61  * This object is described in the 'Portable Document Format Reference Manual version 1.7'
62  * section 3.2.4 (page 56-58).
63  * <P>
64  *
65  * @see PdfObject
66  * @see PdfDictionary
67  * @see BadPdfFormatException
68  */

69
70 public class PdfName extends PdfObject implements Comparable JavaDoc{
71     
72     // static membervariables (a variety of standard names used in PDF)
73

74     /** A name */
75     public static final PdfName A = new PdfName("A");
76     /** A name */
77     public static final PdfName AA = new PdfName("AA");
78     /** A name */
79     public static final PdfName ABSOLUTECALORIMETRIC = new PdfName("AbsoluteColorimetric");
80     /** A name */
81     public static final PdfName AC = new PdfName("AC");
82     /** A name */
83     public static final PdfName ACROFORM = new PdfName("AcroForm");
84     /** A name */
85     public static final PdfName ACTION = new PdfName("Action");
86     /** A name */
87     public static final PdfName ADBE_PKCS7_DETACHED = new PdfName("adbe.pkcs7.detached");
88     /** A name */
89     public static final PdfName ADBE_PKCS7_S4 =new PdfName("adbe.pkcs7.s4");
90     /** A name */
91     public static final PdfName ADBE_PKCS7_S5 =new PdfName("adbe.pkcs7.s5");
92     /** A name */
93     public static final PdfName ADBE_PKCS7_SHA1 = new PdfName("adbe.pkcs7.sha1");
94     /** A name */
95     public static final PdfName ADBE_X509_RSA_SHA1 = new PdfName("adbe.x509.rsa_sha1");
96     /** A name */
97     public static final PdfName ADOBE_PPKLITE = new PdfName("Adobe.PPKLite");
98     /** A name */
99     public static final PdfName ADOBE_PPKMS = new PdfName("Adobe.PPKMS");
100     /** A name */
101     public static final PdfName AESV2 = new PdfName("AESV2");
102     /** A name */
103     public static final PdfName AIS = new PdfName("AIS");
104     /** A name */
105     public static final PdfName ALLPAGES = new PdfName("AllPages");
106     /** A name */
107     public static final PdfName ALT = new PdfName("Alt");
108     /** A name */
109     public static final PdfName ALTERNATE = new PdfName("Alternate");
110     /** A name */
111     public static final PdfName ANNOT = new PdfName("Annot");
112     /** A name */
113     public static final PdfName ANTIALIAS = new PdfName("AntiAlias");
114     /** A name */
115     public static final PdfName ANNOTS = new PdfName("Annots");
116     /** A name */
117     public static final PdfName AP = new PdfName("AP");
118     /** A name */
119     public static final PdfName APPDEFAULT = new PdfName("AppDefault");
120     /** A name */
121     public static final PdfName ARTBOX = new PdfName("ArtBox");
122     /** A name */
123     public static final PdfName ASCENT = new PdfName("Ascent");
124     /** A name */
125     public static final PdfName AS = new PdfName("AS");
126     /** A name */
127     public static final PdfName ASCII85DECODE = new PdfName("ASCII85Decode");
128     /** A name */
129     public static final PdfName ASCIIHEXDECODE = new PdfName("ASCIIHexDecode");
130     /** A name */
131     public static final PdfName AUTHEVENT = new PdfName("AuthEvent");
132     /** A name */
133     public static final PdfName AUTHOR = new PdfName("Author");
134     /** A name */
135     public static final PdfName B = new PdfName("B");
136     /** A name */
137     public static final PdfName BASEENCODING = new PdfName("BaseEncoding");
138     /** A name */
139     public static final PdfName BASEFONT = new PdfName("BaseFont");
140     /** A name */
141     public static final PdfName BBOX = new PdfName("BBox");
142     /** A name */
143     public static final PdfName BC = new PdfName("BC");
144     /** A name */
145     public static final PdfName BG = new PdfName("BG");
146     /** A name */
147     public static final PdfName BIGFIVE = new PdfName("BigFive");
148     /** A name */
149     public static final PdfName BITSPERCOMPONENT = new PdfName("BitsPerComponent");
150     /** A name */
151     public static final PdfName BITSPERSAMPLE = new PdfName("BitsPerSample");
152     /** A name */
153     public static final PdfName BL = new PdfName("Bl");
154     /** A name */
155     public static final PdfName BLACKIS1 = new PdfName("BlackIs1");
156     /** A name */
157     public static final PdfName BLACKPOINT = new PdfName("BlackPoint");
158     /** A name */
159     public static final PdfName BLEEDBOX = new PdfName("BleedBox");
160     /** A name */
161     public static final PdfName BLINDS = new PdfName("Blinds");
162     /** A name */
163     public static final PdfName BM = new PdfName("BM");
164     /** A name */
165     public static final PdfName BORDER = new PdfName("Border");
166     /** A name */
167     public static final PdfName BOUNDS = new PdfName("Bounds");
168     /** A name */
169     public static final PdfName BOX = new PdfName("Box");
170     /** A name */
171     public static final PdfName BS = new PdfName("BS");
172     /** A name */
173     public static final PdfName BTN = new PdfName("Btn");
174     /** A name */
175     public static final PdfName BYTERANGE = new PdfName("ByteRange");
176     /** A name */
177     public static final PdfName C = new PdfName("C");
178     /** A name */
179     public static final PdfName C0 = new PdfName("C0");
180     /** A name */
181     public static final PdfName C1 = new PdfName("C1");
182     /** A name */
183     public static final PdfName CA = new PdfName("CA");
184     /** A name */
185     public static final PdfName ca = new PdfName("ca");
186     /** A name */
187     public static final PdfName CALGRAY = new PdfName("CalGray");
188     /** A name */
189     public static final PdfName CALRGB = new PdfName("CalRGB");
190     /** A name */
191     public static final PdfName CAPHEIGHT = new PdfName("CapHeight");
192     /** A name */
193     public static final PdfName CATALOG = new PdfName("Catalog");
194     /** A name */
195     public static final PdfName CATEGORY = new PdfName("Category");
196     /** A name */
197     public static final PdfName CCITTFAXDECODE = new PdfName("CCITTFaxDecode");
198     /** A name */
199     public static final PdfName CENTERWINDOW = new PdfName("CenterWindow");
200     /** A name */
201     public static final PdfName CERT = new PdfName("Cert");
202     /** A name */
203     public static final PdfName CF = new PdfName("CF");
204     /** A name */
205     public static final PdfName CFM = new PdfName("CFM");
206     /** A name */
207     public static final PdfName CH = new PdfName("Ch");
208     /** A name */
209     public static final PdfName CHARPROCS = new PdfName("CharProcs");
210     /** A name */
211     public static final PdfName CI = new PdfName("CI");
212     /** A name */
213     public static final PdfName CIDFONTTYPE0 = new PdfName("CIDFontType0");
214     /** A name */
215     public static final PdfName CIDFONTTYPE2 = new PdfName("CIDFontType2");
216     /** A name */
217     public static final PdfName CIDSYSTEMINFO = new PdfName("CIDSystemInfo");
218     /** A name */
219     public static final PdfName CIDTOGIDMAP = new PdfName("CIDToGIDMap");
220     /** A name */
221     public static final PdfName CIRCLE = new PdfName("Circle");
222     /** A name */
223     public static final PdfName CO = new PdfName("CO");
224     /** A name */
225     public static final PdfName COLORS = new PdfName("Colors");
226     /** A name */
227     public static final PdfName COLORSPACE = new PdfName("ColorSpace");
228     /** A name */
229     public static final PdfName COLLECTION = new PdfName("Collection");
230     /** A name */
231     public static final PdfName COLLECTIONFIELD = new PdfName("CollectionField");
232     /** A name */
233     public static final PdfName COLLECTIONITEM = new PdfName("CollectionItem");
234     /** A name */
235     public static final PdfName COLLECTIONSCHEMA = new PdfName("CollectionSchema");
236     /** A name */
237     public static final PdfName COLLECTIONSORT = new PdfName("CollectionSort");
238     /** A name */
239     public static final PdfName COLLECTIONSUBITEM = new PdfName("CollectionSubitem");
240     /** A name */
241     public static final PdfName COLUMNS = new PdfName("Columns");
242     /** A name */
243     public static final PdfName CONTACTINFO = new PdfName("ContactInfo");
244     /** A name */
245     public static final PdfName CONTENT = new PdfName("Content");
246     /** A name */
247     public static final PdfName CONTENTS = new PdfName("Contents");
248     /** A name */
249     public static final PdfName COORDS = new PdfName("Coords");
250     /** A name */
251     public static final PdfName COUNT = new PdfName("Count");
252     /** A name of a base 14 type 1 font */
253     public static final PdfName COURIER = new PdfName("Courier");
254     /** A name of a base 14 type 1 font */
255     public static final PdfName COURIER_BOLD = new PdfName("Courier-Bold");
256     /** A name of a base 14 type 1 font */
257     public static final PdfName COURIER_OBLIQUE = new PdfName("Courier-Oblique");
258     /** A name of a base 14 type 1 font */
259     public static final PdfName COURIER_BOLDOBLIQUE = new PdfName("Courier-BoldOblique");
260     /** A name */
261     public static final PdfName CREATIONDATE = new PdfName("CreationDate");
262     /** A name */
263     public static final PdfName CREATOR = new PdfName("Creator");
264     /** A name */
265     public static final PdfName CREATORINFO = new PdfName("CreatorInfo");
266     /** A name */
267     public static final PdfName CROPBOX = new PdfName("CropBox");
268     /** A name */
269     public static final PdfName CRYPT = new PdfName("Crypt");
270     /** A name */
271     public static final PdfName CS = new PdfName("CS");
272     /** A name */
273     public static final PdfName D = new PdfName("D");
274     /** A name */
275     public static final PdfName DA = new PdfName("DA");
276     /** A name */
277     public static final PdfName DATA = new PdfName("Data");
278     /** A name */
279     public static final PdfName DC = new PdfName("DC");
280     /** A name */
281     public static final PdfName DCTDECODE = new PdfName("DCTDecode");
282     /** A name */
283     public static final PdfName DECODE = new PdfName("Decode");
284     /** A name */
285     public static final PdfName DECODEPARMS = new PdfName("DecodeParms");
286     /** A name */
287     public static final PdfName DEFAULTCRYPTFILER = new PdfName("DefaultCryptFilter");
288     /** A name */
289     public static final PdfName DEFAULTCMYK = new PdfName("DefaultCMYK");
290     /** A name */
291     public static final PdfName DEFAULTGRAY = new PdfName("DefaultGray");
292     /** A name */
293     public static final PdfName DEFAULTRGB = new PdfName("DefaultRGB");
294     /** A name */
295     public static final PdfName DESC = new PdfName("Desc");
296     /** A name */
297     public static final PdfName DESCENDANTFONTS = new PdfName("DescendantFonts");
298     /** A name */
299     public static final PdfName DESCENT = new PdfName("Descent");
300     /** A name */
301     public static final PdfName DEST = new PdfName("Dest");
302     /** A name */
303     public static final PdfName DESTOUTPUTPROFILE = new PdfName("DestOutputProfile");
304     /** A name */
305     public static final PdfName DESTS = new PdfName("Dests");
306     /** A name */
307     public static final PdfName DEVICEGRAY = new PdfName("DeviceGray");
308     /** A name */
309     public static final PdfName DEVICERGB = new PdfName("DeviceRGB");
310     /** A name */
311     public static final PdfName DEVICECMYK = new PdfName("DeviceCMYK");
312     /** A name */
313     public static final PdfName DI = new PdfName("Di");
314     /** A name */
315     public static final PdfName DIFFERENCES = new PdfName("Differences");
316     /** A name */
317     public static final PdfName DISSOLVE = new PdfName("Dissolve");
318     /** A name */
319     public static final PdfName DIRECTION = new PdfName("Direction");
320     /** A name */
321     public static final PdfName DISPLAYDOCTITLE = new PdfName("DisplayDocTitle");
322     /** A name */
323     public static final PdfName DIV = new PdfName("Div");
324     /** A name */
325     public static final PdfName DM = new PdfName("Dm");
326     /** A name */
327     public static final PdfName DOCMDP = new PdfName("DocMDP");
328     /** A name */
329     public static final PdfName DOCOPEN = new PdfName("DocOpen");
330     /** A name */
331     public static final PdfName DOMAIN = new PdfName("Domain");
332     /** A name */
333     public static final PdfName DP = new PdfName("DP");
334     /** A name */
335     public static final PdfName DR = new PdfName("DR");
336     /** A name */
337     public static final PdfName DS = new PdfName("DS");
338     /** A name */
339     public static final PdfName DUR = new PdfName("Dur");
340     /** A name */
341     public static final PdfName DUPLEX = new PdfName("Duplex");
342     /** A name */
343     public static final PdfName DUPLEXFLIPSHORTEDGE = new PdfName("DuplexFlipShortEdge");
344     /** A name */
345     public static final PdfName DUPLEXFLIPLONGEDGE = new PdfName("DuplexFlipLongEdge");
346     /** A name */
347     public static final PdfName DV = new PdfName("DV");
348     /** A name */
349     public static final PdfName DW = new PdfName("DW");
350     /** A name */
351     public static final PdfName E = new PdfName("E");
352     /** A name */
353     public static final PdfName EARLYCHANGE = new PdfName("EarlyChange");
354     /** A name */
355     public static final PdfName EF = new PdfName("EF");
356     /** A name */
357     public static final PdfName EMBEDDEDFILE = new PdfName("EmbeddedFile");
358     /** A name */
359     public static final PdfName EMBEDDEDFILES = new PdfName("EmbeddedFiles");
360     /** A name */
361     public static final PdfName ENCODE = new PdfName("Encode");
362     /** A name */
363     public static final PdfName ENCODEDBYTEALIGN = new PdfName("EncodedByteAlign");
364     /** A name */
365     public static final PdfName ENCODING = new PdfName("Encoding");
366     /** A name */
367     public static final PdfName ENCRYPT = new PdfName("Encrypt");
368     /** A name */
369     public static final PdfName ENCRYPTMETADATA = new PdfName("EncryptMetadata");
370     /** A name */
371     public static final PdfName ENDOFBLOCK = new PdfName("EndOfBlock");
372     /** A name */
373     public static final PdfName ENDOFLINE = new PdfName("EndOfLine");
374     /** A name */
375     public static final PdfName EXTEND = new PdfName("Extend");
376     /** A name */
377     public static final PdfName EXTGSTATE = new PdfName("ExtGState");
378     /** A name */
379     public static final PdfName EXPORT = new PdfName("Export");
380     /** A name */
381     public static final PdfName EXPORTSTATE = new PdfName("ExportState");
382     /** A name */
383     public static final PdfName EVENT = new PdfName("Event");
384     /** A name */
385     public static final PdfName F = new PdfName("F");
386     /** A name */
387     public static final PdfName FB = new PdfName("FB");
388     /** A name */
389     public static final PdfName FDECODEPARMS = new PdfName("FDecodeParms");
390     /** A name */
391     public static final PdfName FDF = new PdfName("FDF");
392     /** A name */
393     public static final PdfName FF = new PdfName("Ff");
394     /** A name */
395     public static final PdfName FFILTER = new PdfName("FFilter");
396     /** A name */
397     public static final PdfName FIELDS = new PdfName("Fields");
398     /** A name */
399     public static final PdfName FILEATTACHMENT = new PdfName("FileAttachment");
400     /** A name */
401     public static final PdfName FILESPEC = new PdfName("Filespec");
402     /** A name */
403     public static final PdfName FILTER = new PdfName("Filter");
404     /** A name */
405     public static final PdfName FIRST = new PdfName("First");
406     /** A name */
407     public static final PdfName FIRSTCHAR = new PdfName("FirstChar");
408     /** A name */
409     public static final PdfName FIRSTPAGE = new PdfName("FirstPage");
410     /** A name */
411     public static final PdfName FIT = new PdfName("Fit");
412     /** A name */
413     public static final PdfName FITH = new PdfName("FitH");
414     /** A name */
415     public static final PdfName FITV = new PdfName("FitV");
416     /** A name */
417     public static final PdfName FITR = new PdfName("FitR");
418     /** A name */
419     public static final PdfName FITB = new PdfName("FitB");
420     /** A name */
421     public static final PdfName FITBH = new PdfName("FitBH");
422     /** A name */
423     public static final PdfName FITBV = new PdfName("FitBV");
424     /** A name */
425     public static final PdfName FITWINDOW = new PdfName("FitWindow");
426     /** A name */
427     public static final PdfName FLAGS = new PdfName("Flags");
428     /** A name */
429     public static final PdfName FLATEDECODE = new PdfName("FlateDecode");
430     /** A name */
431     public static final PdfName FO = new PdfName("Fo");
432     /** A name */
433     public static final PdfName FONT = new PdfName("Font");
434     /** A name */
435     public static final PdfName FONTBBOX = new PdfName("FontBBox");
436     /** A name */
437     public static final PdfName FONTDESCRIPTOR = new PdfName("FontDescriptor");
438     /** A name */
439     public static final PdfName FONTFILE = new PdfName("FontFile");
440     /** A name */
441     public static final PdfName FONTFILE2 = new PdfName("FontFile2");
442     /** A name */
443     public static final PdfName FONTFILE3 = new PdfName("FontFile3");
444     /** A name */
445     public static final PdfName FONTMATRIX = new PdfName("FontMatrix");
446     /** A name */
447     public static final PdfName FONTNAME = new PdfName("FontName");
448     /** A name */
449     public static final PdfName FORM = new PdfName("Form");
450     /** A name */
451     public static final PdfName FORMTYPE = new PdfName("FormType");
452     /** A name */
453     public static final PdfName FREETEXT = new PdfName("FreeText");
454     /** A name */
455     public static final PdfName FRM = new PdfName("FRM");
456     /** A name */
457     public static final PdfName FS = new PdfName("FS");
458     /** A name */
459     public static final PdfName FT = new PdfName("FT");
460     /** A name */
461     public static final PdfName FULLSCREEN = new PdfName("FullScreen");
462     /** A name */
463     public static final PdfName FUNCTION = new PdfName("Function");
464     /** A name */
465     public static final PdfName FUNCTIONS = new PdfName("Functions");
466     /** A name */
467     public static final PdfName FUNCTIONTYPE = new PdfName("FunctionType");
468     /** A name of an attribute. */
469     public static final PdfName GAMMA = new PdfName("Gamma");
470     /** A name of an attribute. */
471     public static final PdfName GBK = new PdfName("GBK");
472     /** A name of an attribute. */
473     public static final PdfName GLITTER = new PdfName("Glitter");
474     /** A name of an attribute. */
475     public static final PdfName GOTO = new PdfName("GoTo");
476     /** A name of an attribute. */
477     public static final PdfName GOTOE = new PdfName("GoToE");
478     /** A name of an attribute. */
479     public static final PdfName GOTOR = new PdfName("GoToR");
480     /** A name of an attribute. */
481     public static final PdfName GROUP = new PdfName("Group");
482     /** A name of an attribute. */
483     public static final PdfName GTS_PDFX = new PdfName("GTS_PDFX");
484     /** A name of an attribute. */
485     public static final PdfName GTS_PDFXVERSION = new PdfName("GTS_PDFXVersion");
486     /** A name of an attribute. */
487     public static final PdfName H = new PdfName("H");
488     /** A name of an attribute. */
489     public static final PdfName HEIGHT = new PdfName("Height");
490     /** A name */
491     public static final PdfName HELV = new PdfName("Helv");
492     /** A name of a base 14 type 1 font */
493     public static final PdfName HELVETICA = new PdfName("Helvetica");
494     /** A name of a base 14 type 1 font */
495     public static final PdfName HELVETICA_BOLD = new PdfName("Helvetica-Bold");
496     /** This is a static PdfName PdfName of a base 14 type 1 font */
497     public static final PdfName HELVETICA_OBLIQUE = new PdfName("Helvetica-Oblique");
498     /** This is a static PdfName PdfName of a base 14 type 1 font */
499     public static final PdfName HELVETICA_BOLDOBLIQUE = new PdfName("Helvetica-BoldOblique");
500     /** A name */
501     public static final PdfName HID = new PdfName("Hid");
502     /** A name */
503     public static final PdfName HIDE = new PdfName("Hide");
504     /** A name */
505     public static final PdfName HIDEMENUBAR = new PdfName("HideMenubar");
506     /** A name */
507     public static final PdfName HIDETOOLBAR = new PdfName("HideToolbar");
508     /** A name */
509     public static final PdfName HIDEWINDOWUI = new PdfName("HideWindowUI");
510     /** A name */
511     public static final PdfName HIGHLIGHT = new PdfName("Highlight");
512     /** A name */
513     public static final PdfName I = new PdfName("I");
514     /** A name */
515     public static final PdfName ICCBASED = new PdfName("ICCBased");
516     /** A name */
517     public static final PdfName ID = new PdfName("ID");
518     /** A name */
519     public static final PdfName IDENTITY = new PdfName("Identity");
520     /** A name */
521     public static final PdfName IF = new PdfName("IF");
522     /** A name */
523     public static final PdfName IMAGE = new PdfName("Image");
524     /** A name */
525     public static final PdfName IMAGEB = new PdfName("ImageB");
526     /** A name */
527     public static final PdfName IMAGEC = new PdfName("ImageC");
528     /** A name */
529     public static final PdfName IMAGEI = new PdfName("ImageI");
530     /** A name */
531     public static final PdfName IMAGEMASK = new PdfName("ImageMask");
532     /** A name */
533     public static final PdfName INDEX = new PdfName("Index");
534     /** A name */
535     public static final PdfName INDEXED = new PdfName("Indexed");
536     /** A name */
537     public static final PdfName INFO = new PdfName("Info");
538     /** A name */
539     public static final PdfName INK = new PdfName("Ink");
540     /** A name */
541     public static final PdfName INKLIST = new PdfName("InkList");
542     /** A name */
543     public static final PdfName IMPORTDATA = new PdfName("ImportData");
544     /** A name */
545     public static final PdfName INTENT = new PdfName("Intent");
546     /** A name */
547     public static final PdfName INTERPOLATE = new PdfName("Interpolate");
548     /** A name */
549     public static final PdfName ISMAP = new PdfName("IsMap");
550     /** A name */
551     public static final PdfName IRT = new PdfName("IRT");
552     /** A name */
553     public static final PdfName ITALICANGLE = new PdfName("ItalicAngle");
554     /** A name */
555     public static final PdfName IX = new PdfName("IX");
556     /** A name */
557     public static final PdfName JAVASCRIPT = new PdfName("JavaScript");
558     /** A name */
559     public static final PdfName JS = new PdfName("JS");
560     /** A name */
561     public static final PdfName K = new PdfName("K");
562     /** A name */
563     public static final PdfName KEYWORDS = new PdfName("Keywords");
564     /** A name */
565     public static final PdfName KIDS = new PdfName("Kids");
566     /** A name */
567     public static final PdfName L = new PdfName("L");
568     /** A name */
569     public static final PdfName L2R = new PdfName("L2R");
570     /** A name */
571     public static final PdfName LANG = new PdfName("Lang");
572     /** A name */
573     public static final PdfName LANGUAGE = new PdfName("Language");
574     /** A name */
575     public static final PdfName LAST = new PdfName("Last");
576     /** A name */
577     public static final PdfName LASTCHAR = new PdfName("LastChar");
578     /** A name */
579     public static final PdfName LASTPAGE = new PdfName("LastPage");
580     /** A name */
581     public static final PdfName LAUNCH = new PdfName("Launch");
582     /** A name */
583     public static final PdfName LENGTH = new PdfName("Length");
584     /** A name */
585     public static final PdfName LENGTH1 = new PdfName("Length1");
586     /** A name */
587     public static final PdfName LIMITS = new PdfName("Limits");
588     /** A name */
589     public static final PdfName LINE = new PdfName("Line");
590     /** A name */
591     public static final PdfName LINK = new PdfName("Link");
592     /** A name */
593     public static final PdfName LISTMODE = new PdfName("ListMode");
594     /** A name */
595     public static final PdfName LOCATION = new PdfName("Location");
596     /** A name */
597     public static final PdfName LOCK = new PdfName("Lock");
598     /** A name */
599     public static final PdfName LZWDECODE = new PdfName("LZWDecode");
600     /** A name */
601     public static final PdfName M = new PdfName("M");
602     /** A name */
603     public static final PdfName MATRIX = new PdfName("Matrix");
604     /** A name of an encoding */
605     public static final PdfName MAC_EXPERT_ENCODING = new PdfName("MacExpertEncoding");
606     /** A name of an encoding */
607     public static final PdfName MAC_ROMAN_ENCODING = new PdfName("MacRomanEncoding");
608     /** A name */
609     public static final PdfName MARKED = new PdfName("Marked");
610     /** A name */
611     public static final PdfName MARKINFO = new PdfName("MarkInfo");
612     /** A name */
613     public static final PdfName MASK = new PdfName("Mask");
614     /** A name */
615     public static final PdfName MAX = new PdfName("max");
616     /** A name */
617     public static final PdfName MAXLEN = new PdfName("MaxLen");
618     /** A name */
619     public static final PdfName MEDIABOX = new PdfName("MediaBox");
620     /** A name */
621     public static final PdfName MCID = new PdfName("MCID");
622     /** A name */
623     public static final PdfName MCR = new PdfName("MCR");
624     /** A name */
625     public static final PdfName METADATA = new PdfName("Metadata");
626     /** A name */
627     public static final PdfName MIN = new PdfName("min");
628     /** A name */
629     public static final PdfName MK = new PdfName("MK");
630     /** A name */
631     public static final PdfName MMTYPE1 = new PdfName("MMType1");
632     /** A name */
633     public static final PdfName MODDATE = new PdfName("ModDate");
634     /** A name */
635     public static final PdfName N = new PdfName("N");
636     /** A name */
637     public static final PdfName N0 = new PdfName("n0");
638     /** A name */
639     public static final PdfName N1 = new PdfName("n1");
640     /** A name */
641     public static final PdfName N2 = new PdfName("n2");
642     /** A name */
643     public static final PdfName N3 = new PdfName("n3");
644     /** A name */
645     public static final PdfName N4 = new PdfName("n4");
646     /** A name */
647     public static final PdfName NAME = new PdfName("Name");
648     /** A name */
649     public static final PdfName NAMED = new PdfName("Named");
650     /** A name */
651     public static final PdfName NAMES = new PdfName("Names");
652     /** A name */
653     public static final PdfName NEEDAPPEARANCES = new PdfName("NeedAppearances");
654     /** A name */
655     public static final PdfName NEWWINDOW = new PdfName("NewWindow");
656     /** A name */
657     public static final PdfName NEXT = new PdfName("Next");
658     /** A name */
659     public static final PdfName NEXTPAGE = new PdfName("NextPage");
660     /** A name */
661     public static final PdfName NM = new PdfName("NM");
662     /** A name */
663     public static final PdfName NONE = new PdfName("None");
664     /** A name */
665     public static final PdfName NONFULLSCREENPAGEMODE = new PdfName("NonFullScreenPageMode");
666     /** A name */
667     public static final PdfName NUMCOPIES = new PdfName("NumCopies");
668     /** A name */
669     public static final PdfName NUMS = new PdfName("Nums");
670     /** A name */
671     public static final PdfName O = new PdfName("O");
672     /** A name */
673     public static final PdfName OBJSTM = new PdfName("ObjStm");
674     /** A name */
675     public static final PdfName OC = new PdfName("OC");
676     /** A name */
677     public static final PdfName OCG = new PdfName("OCG");
678     /** A name */
679     public static final PdfName OCGS = new PdfName("OCGs");
680     /** A name */
681     public static final PdfName OCMD = new PdfName("OCMD");
682     /** A name */
683     public static final PdfName OCPROPERTIES = new PdfName("OCProperties");
684     /** A name */
685     public static final PdfName Off = new PdfName("Off");
686     /** A name */
687     public static final PdfName OFF = new PdfName("OFF");
688     /** A name */
689     public static final PdfName ON = new PdfName("ON");
690     /** A name */
691     public static final PdfName ONECOLUMN = new PdfName("OneColumn");
692     /** A name */
693     public static final PdfName OPEN = new PdfName("Open");
694     /** A name */
695     public static final PdfName OPENACTION = new PdfName("OpenAction");
696     /** A name */
697     public static final PdfName OP = new PdfName("OP");
698     /** A name */
699     public static final PdfName op = new PdfName("op");
700     /** A name */
701     public static final PdfName OPM = new PdfName("OPM");
702     /** A name */
703     public static final PdfName OPT = new PdfName("Opt");
704     /** A name */
705     public static final PdfName ORDER = new PdfName("Order");
706     /** A name */
707     public static final PdfName ORDERING = new PdfName("Ordering");
708     /** A name */
709     public static final PdfName OUTLINES = new PdfName("Outlines");
710     /** A name */
711     public static final PdfName OUTPUTCONDITION = new PdfName("OutputCondition");
712     /** A name */
713     public static final PdfName OUTPUTCONDITIONIDENTIFIER = new PdfName("OutputConditionIdentifier");
714     /** A name */
715     public static final PdfName OUTPUTINTENT = new PdfName("OutputIntent");
716     /** A name */
717     public static final PdfName OUTPUTINTENTS = new PdfName("OutputIntents");
718     /** A name */
719     public static final PdfName P = new PdfName("P");
720     /** A name */
721     public static final PdfName PAGE = new PdfName("Page");
722     /** A name */
723     public static final PdfName PAGELABELS = new PdfName("PageLabels");
724     /** A name */
725     public static final PdfName PAGELAYOUT = new PdfName("PageLayout");
726     /** A name */
727     public static final PdfName PAGEMODE = new PdfName("PageMode");
728     /** A name */
729     public static final PdfName PAGES = new PdfName("Pages");
730     /** A name */
731     public static final PdfName PAINTTYPE = new PdfName("PaintType");
732     /** A name */
733     public static final PdfName PANOSE = new PdfName("Panose");
734     /** A name */
735     public static final PdfName PARAMS = new PdfName("Params");
736     /** A name */
737     public static final PdfName PARENT = new PdfName("Parent");
738     /** A name */
739     public static final PdfName PARENTTREE = new PdfName("ParentTree");
740     /** A name */
741     public static final PdfName PATTERN = new PdfName("Pattern");
742     /** A name */
743     public static final PdfName PATTERNTYPE = new PdfName("PatternType");
744     /** A name */
745     public static final PdfName PDF = new PdfName("PDF");
746     /** A name */
747     public static final PdfName PDFDOCENCODING = new PdfName("PDFDocEncoding");
748     /** A name */
749     public static final PdfName PERCEPTUAL = new PdfName("Perceptual");
750     /** A name */
751     public static final PdfName PERMS = new PdfName("Perms");
752     /** A name */
753     public static final PdfName PG = new PdfName("Pg");
754     /** A name */
755     public static final PdfName PICKTRAYBYPDFSIZE = new PdfName("PickTrayByPDFSize");
756     /** A name */
757     public static final PdfName POPUP = new PdfName("Popup");
758     /** A name */
759     public static final PdfName PREDICTOR = new PdfName("Predictor");
760     /** A name */
761     public static final PdfName PREFERRED = new PdfName("Preferred");
762     /** A name */
763     public static final PdfName PRESERVERB = new PdfName("PreserveRB");
764     /** A name */
765     public static final PdfName PREV = new PdfName("Prev");
766     /** A name */
767     public static final PdfName PREVPAGE = new PdfName("PrevPage");
768     /** A name */
769     public static final PdfName PRINT = new PdfName("Print");
770     /** A name */
771     public static final PdfName PRINTAREA = new PdfName("PrintArea");
772     /** A name */
773     public static final PdfName PRINTCLIP = new PdfName("PrintClip");
774     /** A name */
775     public static final PdfName PRINTPAGERANGE = new PdfName("PrintPageRange");
776     /** A name */
777     public static final PdfName PRINTSCALING = new PdfName("PrintScaling");
778     /** A name */
779     public static final PdfName PRINTSTATE = new PdfName("PrintState");
780     /** A name */
781     public static final PdfName PROCSET = new PdfName("ProcSet");
782     /** A name */
783     public static final PdfName PRODUCER = new PdfName("Producer");
784     /** A name */
785     public static final PdfName PROPERTIES = new PdfName("Properties");
786     /** A name */
787     public static final PdfName PS = new PdfName("PS");
788     /** A name */
789     public static final PdfName PUBSEC = new PdfName("Adobe.PubSec");
790     /** A name */
791     public static final PdfName Q = new PdfName("Q");
792     /** A name */
793     public static final PdfName QUADPOINTS = new PdfName("QuadPoints");
794     /** A name */
795     public static final PdfName R = new PdfName("R");
796     /** A name */
797     public static final PdfName R2L = new PdfName("R2L");
798     /** A name */
799     public static final PdfName RANGE = new PdfName("Range");
800     /** A name */
801     public static final PdfName RC = new PdfName("RC");
802     /** A name */
803     public static final PdfName RBGROUPS = new PdfName("RBGroups");
804     /** A name */
805     public static final PdfName REASON = new PdfName("Reason");
806     /** A name */
807     public static final PdfName RECIPIENTS = new PdfName("Recipients");
808     /** A name */
809     public static final PdfName RECT = new PdfName("Rect");
810     /** A name */
811     public static final PdfName REFERENCE = new PdfName("Reference");
812     /** A name */
813     public static final PdfName REGISTRY = new PdfName("Registry");
814     /** A name */
815     public static final PdfName REGISTRYNAME = new PdfName("RegistryName");
816     /** A name */
817     public static final PdfName RELATIVECALORIMETRIC = new PdfName("RelativeColorimetric");
818     /** A name */
819     public static final PdfName RENDITION = new PdfName("Rendition");
820     /** A name */
821     public static final PdfName RESETFORM = new PdfName("ResetForm");
822     /** A name */
823     public static final PdfName RESOURCES = new PdfName("Resources");
824     /** A name */
825     public static final PdfName RI = new PdfName("RI");
826     /** A name */
827     public static final PdfName ROLEMAP = new PdfName("RoleMap");
828     /** A name */
829     public static final PdfName ROOT = new PdfName("Root");
830     /** A name */
831     public static final PdfName ROTATE = new PdfName("Rotate");
832     /** A name */
833     public static final PdfName ROWS = new PdfName("Rows");
834     /** A name */
835     public static final PdfName RUNLENGTHDECODE = new PdfName("RunLengthDecode");
836     /** A name */
837     public static final PdfName RV = new PdfName("RV");
838     /** A name */
839     public static final PdfName S = new PdfName("S");
840     /** A name */
841     public static final PdfName SATURATION = new PdfName("Saturation");
842     /** A name */
843     public static final PdfName SCHEMA = new PdfName("Schema");
844     /** A name */
845     public static final PdfName SCREEN = new PdfName("Screen");
846     /** A name */
847     public static final PdfName SECT = new PdfName("Sect");
848     /** A name */
849     public static final PdfName SEPARATION = new PdfName("Separation");
850     /** A name */
851     public static final PdfName SETOCGSTATE = new PdfName("SetOCGState");
852     /** A name */
853     public static final PdfName SHADING = new PdfName("Shading");
854     /** A name */
855     public static final PdfName SHADINGTYPE = new PdfName("ShadingType");
856     /** A name */
857     public static final PdfName SHIFT_JIS = new PdfName("Shift-JIS");
858     /** A name */
859     public static final PdfName SIG = new PdfName("Sig");
860     /** A name */
861     public static final PdfName SIGFLAGS = new PdfName("SigFlags");
862     /** A name */
863     public static final PdfName SIGREF = new PdfName("SigRef");
864     /** A name */
865     public static final PdfName SIMPLEX = new PdfName("Simplex");
866     /** A name */
867     public static final PdfName SINGLEPAGE = new PdfName("SinglePage");
868     /** A name */
869     public static final PdfName SIZE = new PdfName("Size");
870     /** A name */
871     public static final PdfName SMASK = new PdfName("SMask");
872     /** A name */
873     public static final PdfName SORT = new PdfName("Sort");
874     /** A name */
875     public static final PdfName SPAN = new PdfName("Span");
876     /** A name */
877     public static final PdfName SPLIT = new PdfName("Split");
878     /** A name */
879     public static final PdfName SQUARE = new PdfName("Square");
880     /** A name */
881     public static final PdfName ST = new PdfName("St");
882     /** A name */
883     public static final PdfName STAMP = new PdfName("Stamp");
884     /** A name */
885     public static final PdfName STANDARD = new PdfName("Standard");
886     /** A name */
887     public static final PdfName STATE = new PdfName("State");
888     /** A name */
889     public static final PdfName STDCF = new PdfName("StdCF");
890     /** A name */
891     public static final PdfName STEMV = new PdfName("StemV");
892     /** A name */
893     public static final PdfName STMF = new PdfName("StmF");
894     /** A name */
895     public static final PdfName STRF = new PdfName("StrF");
896     /** A name */
897     public static final PdfName STRIKEOUT = new PdfName("StrikeOut");
898     /** A name */
899     public static final PdfName STRUCTPARENT = new PdfName("StructParent");
900     /** A name */
901     public static final PdfName STRUCTPARENTS = new PdfName("StructParents");
902     /** A name */
903     public static final PdfName STRUCTTREEROOT = new PdfName("StructTreeRoot");
904     /** A name */
905     public static final PdfName STYLE = new PdfName("Style");
906     /** A name */
907     public static final PdfName SUBFILTER = new PdfName("SubFilter");
908     /** A name */
909     public static final PdfName SUBJECT = new PdfName("Subject");
910     /** A name */
911     public static final PdfName SUBMITFORM = new PdfName("SubmitForm");
912     /** A name */
913     public static final PdfName SUBTYPE = new PdfName("Subtype");
914     /** A name */
915     public static final PdfName SUPPLEMENT = new PdfName("Supplement");
916     /** A name */
917     public static final PdfName SV = new PdfName("SV");
918     /** A name */
919     public static final PdfName SW = new PdfName("SW");
920     /** A name of a base 14 type 1 font */
921     public static final PdfName SYMBOL = new PdfName("Symbol");
922     /** A name */
923     public static final PdfName T = new PdfName("T");
924     /** A name */
925     public static final PdfName TEXT = new PdfName("Text");
926     /** A name */
927     public static final PdfName THUMB = new PdfName("Thumb");
928     /** A name */
929     public static final PdfName THREADS = new PdfName("Threads");
930     /** A name */
931     public static final PdfName TI = new PdfName("TI");
932     /** A name */
933     public static final PdfName TILINGTYPE = new PdfName("TilingType");
934     /** A name of a base 14 type 1 font */
935     public static final PdfName TIMES_ROMAN = new PdfName("Times-Roman");
936     /** A name of a base 14 type 1 font */
937     public static final PdfName TIMES_BOLD = new PdfName("Times-Bold");
938     /** A name of a base 14 type 1 font */
939     public static final PdfName TIMES_ITALIC = new PdfName("Times-Italic");
940     /** A name of a base 14 type 1 font */
941     public static final PdfName TIMES_BOLDITALIC = new PdfName("Times-BoldItalic");
942     /** A name */
943     public static final PdfName TITLE = new PdfName("Title");
944     /** A name */
945     public static final PdfName TK = new PdfName("TK");
946     /** A name */
947     public static final PdfName TM = new PdfName("TM");
948     /** A name */
949     public static final PdfName TOGGLE = new PdfName("Toggle");
950     /** A name */
951     public static final PdfName TOUNICODE = new PdfName("ToUnicode");
952     /** A name */
953     public static final PdfName TP = new PdfName("TP");
954     /** A name */
955     public static final PdfName TRANS = new PdfName("Trans");
956     /** A name */
957     public static final PdfName TRANSFORMPARAMS = new PdfName("TransformParams");
958     /** A name */
959     public static final PdfName TRANSFORMMETHOD = new PdfName("TransformMethod");
960     /** A name */
961     public static final PdfName TRANSPARENCY = new PdfName("Transparency");
962     /** A name */
963     public static final PdfName TRAPPED = new PdfName("Trapped");
964     /** A name */
965     public static final PdfName TRIMBOX = new PdfName("TrimBox");
966     /** A name */
967     public static final PdfName TRUETYPE = new PdfName("TrueType");
968     /** A name */
969     public static final PdfName TU = new PdfName("TU");
970     /** A name */
971     public static final PdfName TWOCOLUMNLEFT = new PdfName("TwoColumnLeft");
972     /** A name */
973     public static final PdfName TWOCOLUMNRIGHT = new PdfName("TwoColumnRight");
974     /** A name */
975     public static final PdfName TWOPAGELEFT = new PdfName("TwoPageLeft");
976     /** A name */
977     public static final PdfName TWOPAGERIGHT = new PdfName("TwoPageRight");
978     /** A name */
979     public static final PdfName TX = new PdfName("Tx");
980     /** A name */
981     public static final PdfName TYPE = new PdfName("Type");
982     /** A name */
983     public static final PdfName TYPE0 = new PdfName("Type0");
984     /** A name */
985     public static final PdfName TYPE1 = new PdfName("Type1");
986     /** A name of an attribute. */
987     public static final PdfName TYPE3 = new PdfName("Type3");
988     /** A name of an attribute. */
989     public static final PdfName U = new PdfName("U");
990     /** A name of an attribute. */
991     public static final PdfName UF = new PdfName("UF");
992     /** A name of an attribute. */
993     public static final PdfName UHC = new PdfName("UHC");
994     /** A name of an attribute. */
995     public static final PdfName UNDERLINE = new PdfName("Underline");
996     /** A name */
997     public static final PdfName UR = new PdfName("UR");
998     /** A name */
999     public static final PdfName UR3 = new PdfName("UR3");
1000    /** A name */
1001    public static final PdfName URI = new PdfName("URI");
1002    /** A name */
1003    public static final PdfName URL = new PdfName("URL");
1004    /** A name */
1005    public static final PdfName USAGE = new PdfName("Usage");
1006    /** A name */
1007    public static final PdfName USEATTACHMENTS = new PdfName("UseAttachments");
1008    /** A name */
1009    public static final PdfName USENONE = new PdfName("UseNone");
1010    /** A name */
1011    public static final PdfName USEOC = new PdfName("UseOC");
1012    /** A name */
1013    public static final PdfName USEOUTLINES = new PdfName("UseOutlines");
1014    /** A name */
1015    public static final PdfName USER = new PdfName("User");
1016    /** A name */
1017    public static final PdfName USERPROPERTIES = new PdfName("UserProperties");
1018    /** A name */
1019    public static final PdfName USERUNIT = new PdfName("UserUnit");
1020    /** A name */
1021    public static final PdfName USETHUMBS = new PdfName("UseThumbs");
1022    /** A name */
1023    public static final PdfName V = new PdfName("V");
1024    /** A name */
1025    public static final PdfName V2 = new PdfName("V2");
1026    /** A name */
1027    public static final PdfName VERISIGN_PPKVS = new PdfName("VeriSign.PPKVS");
1028    /** A name */
1029    public static final PdfName VERSION = new PdfName("Version");
1030    /** A name */
1031    public static final PdfName VIEW = new PdfName("View");
1032    /** A name */
1033    public static final PdfName VIEWAREA = new PdfName("ViewArea");
1034    /** A name */
1035    public static final PdfName VIEWCLIP = new PdfName("ViewClip");
1036    /** A name */
1037    public static final PdfName VIEWERPREFERENCES = new PdfName("ViewerPreferences");
1038    /** A name */
1039    public static final PdfName VIEWSTATE = new PdfName("ViewState");
1040    /** A name */
1041    public static final PdfName VISIBLEPAGES = new PdfName("VisiblePages");
1042    /** A name of an attribute. */
1043    public static final PdfName W = new PdfName("W");
1044    /** A name of an attribute. */
1045    public static final PdfName W2 = new PdfName("W2");
1046    /** A name of an attribute. */
1047    public static final PdfName WC = new PdfName("WC");
1048    /** A name of an attribute. */
1049    public static final PdfName WIDGET = new PdfName("Widget");
1050    /** A name of an attribute. */
1051    public static final PdfName WIDTH = new PdfName("Width");
1052    /** A name */
1053    public static final PdfName WIDTHS = new PdfName("Widths");
1054    /** A name of an encoding */
1055    public static final PdfName WIN = new PdfName("Win");
1056    /** A name of an encoding */
1057    public static final PdfName WIN_ANSI_ENCODING = new PdfName("WinAnsiEncoding");
1058    /** A name of an encoding */
1059    public static final PdfName WIPE = new PdfName("Wipe");
1060    /** A name */
1061    public static final PdfName WHITEPOINT = new PdfName("WhitePoint");
1062    /** A name */
1063    public static final PdfName WP = new PdfName("WP");
1064    /** A name of an encoding */
1065    public static final PdfName WS = new PdfName("WS");
1066    /** A name */
1067    public static final PdfName X = new PdfName("X");
1068    /** A name */
1069    public static final PdfName XFA = new PdfName("XFA");
1070    /** A name */
1071    public static final PdfName XML = new PdfName("XML");
1072    /** A name */
1073    public static final PdfName XOBJECT = new PdfName("XObject");
1074    /** A name */
1075    public static final PdfName XSTEP = new PdfName("XStep");
1076    /** A name */
1077    public static final PdfName XREF = new PdfName("XRef");
1078    /** A name */
1079    public static final PdfName XREFSTM = new PdfName("XRefStm");
1080    /** A name */
1081    public static final PdfName XYZ = new PdfName("XYZ");
1082    /** A name */
1083    public static final PdfName YSTEP = new PdfName("YStep");
1084    /** A name */
1085    public static final PdfName ZADB = new PdfName("ZaDb");
1086    /** A name of a base 14 type 1 font */
1087    public static final PdfName ZAPFDINGBATS = new PdfName("ZapfDingbats");
1088    /** A name */
1089    public static final PdfName ZOOM = new PdfName("Zoom");
1090    
1091    private int hash = 0;
1092    
1093    // constructors
1094

1095
1096    /**
1097     * Constructs a new <CODE>PdfName</CODE>. The name length will be checked.
1098     * @param name the new name
1099     */

1100    public PdfName(String JavaDoc name) {
1101        this(name, true);
1102    }
1103    
1104    /**
1105     * Constructs a new <CODE>PdfName</CODE>.
1106     * @param name the new name
1107     * @param lengthCheck if <CODE>true</CODE> check the lenght validity, if <CODE>false</CODE> the name can
1108     * have any length
1109     */

1110    
1111    public PdfName(String JavaDoc name, boolean lengthCheck) {
1112        super(PdfObject.NAME);
1113        // The minimum number of characters in a name is 0, the maximum is 127 (the '/' not included)
1114
int length = name.length();
1115        if (lengthCheck && length > 127) {
1116            throw new IllegalArgumentException JavaDoc("The name '" + name + "' is too long (" + length + " characters).");
1117        }
1118        // The name has to be checked for illegal characters
1119
// every special character has to be substituted
1120
ByteBuffer pdfName = new ByteBuffer(length + 20);
1121        pdfName.append('/');
1122        char character;
1123        char chars[] = name.toCharArray();
1124        // loop over all the characters
1125
for (int index = 0; index < length; index++) {
1126            character = (char)(chars[index] & 0xff);
1127            // special characters are escaped (reference manual p.39)
1128
switch (character) {
1129                case ' ':
1130                case '%':
1131                case '(':
1132                case ')':
1133                case '<':
1134                case '>':
1135                case '[':
1136                case ']':
1137                case '{':
1138                case '}':
1139                case '/':
1140                case '#':
1141                    pdfName.append('#');
1142                    pdfName.append(Integer.toString((int) character, 16));
1143                    break;
1144                default:
1145                    if (character > 126 || character < 32) {
1146                        pdfName.append('#');
1147                        if (character < 16)
1148                            pdfName.append('0');
1149                        pdfName.append(Integer.toString((int) character, 16));
1150                    }
1151                    else
1152                        pdfName.append(character);
1153                    break;
1154            }
1155        }
1156        bytes = pdfName.toByteArray();
1157    }
1158    
1159    /**
1160     * Constructs a PdfName.
1161     * @param bytes the byte representation of the name
1162     */

1163    public PdfName(byte bytes[]) {
1164        super(PdfObject.NAME, bytes);
1165    }
1166    // methods
1167

1168    /**
1169     * Compares this object with the specified object for order. Returns a
1170     * negative integer, zero, or a positive integer as this object is less
1171     * than, equal to, or greater than the specified object.<p>
1172     * @param object the Object to be compared.
1173     * @return a negative integer, zero, or a positive integer as this object
1174     * is less than, equal to, or greater than the specified object.
1175     * @throws ClassCastException if the specified object's type prevents it
1176     * from being compared to this Object.
1177     */

1178    public int compareTo(Object JavaDoc object) {
1179        PdfName name = (PdfName) object;
1180        
1181        byte myBytes[] = bytes;
1182        byte objBytes[] = name.bytes;
1183        int len = Math.min(myBytes.length, objBytes.length);
1184        for(int i=0; i<len; i++) {
1185            if(myBytes[i] > objBytes[i])
1186                return 1;
1187            
1188            if(myBytes[i] < objBytes[i])
1189                return -1;
1190        }
1191        if (myBytes.length < objBytes.length)
1192            return -1;
1193        if (myBytes.length > objBytes.length)
1194            return 1;
1195        return 0;
1196    }
1197    
1198    /**
1199     * Indicates whether some other object is "equal to" this one.
1200     *
1201     * @param obj the reference object with which to compare.
1202     * @return <code>true</code> if this object is the same as the obj
1203     * argument; <code>false</code> otherwise.
1204     */

1205    public boolean equals(Object JavaDoc obj) {
1206        if (this == obj)
1207            return true;
1208        if (obj instanceof PdfName)
1209            return compareTo(obj) == 0;
1210        return false;
1211    }
1212    
1213    /**
1214     * Returns a hash code value for the object. This method is
1215     * supported for the benefit of hashtables such as those provided by
1216     * <code>java.util.Hashtable</code>.
1217     *
1218     * @return a hash code value for this object.
1219     */

1220    public int hashCode() {
1221        int h = hash;
1222        if (h == 0) {
1223            int ptr = 0;
1224            int len = bytes.length;
1225            
1226            for (int i = 0; i < len; i++)
1227                h = 31*h + (bytes[ptr++] & 0xff);
1228            hash = h;
1229        }
1230        return h;
1231    }
1232    
1233    /** Decodes an escaped name in the form "/AB#20CD" into "AB CD".
1234     * @param name the name to decode
1235     * @return the decoded name
1236     */

1237    public static String JavaDoc decodeName(String JavaDoc name) {
1238        StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
1239        try {
1240            int len = name.length();
1241            for (int k = 1; k < len; ++k) {
1242                char c = name.charAt(k);
1243                if (c == '#') {
1244                    c = (char)((PRTokeniser.getHex(name.charAt(k + 1)) << 4) + PRTokeniser.getHex(name.charAt(k + 2)));
1245                    k += 2;
1246                }
1247                buf.append(c);
1248            }
1249        }
1250        catch (IndexOutOfBoundsException JavaDoc e) {
1251            // empty on purpose
1252
}
1253        return buf.toString();
1254    }
1255}
1256
Popular Tags