📄 pdfname.java
字号:
/** This is a static final PdfName */
public static final PdfName LZWDECODE = new PdfName("/LZWDecode", 0);
/** This is a static final PdfName */
public static final PdfName MATRIX = new PdfName("/Matrix", 0);
/** This is a static final PdfName of an encoding */
public static final PdfName MAC_EXPERT_ENCODING = new PdfName("/MacExpertEncoding", 0);
/** This is a static final PdfName of an encoding */
public static final PdfName MAC_ROMAN_ENCODING = new PdfName("/MacRomanEncoding", 0);
/** This is a static final PdfName of an encoding */
public static final PdfName MASK = new PdfName("/Mask", 0);
/** This is a static final PdfName */
public static final PdfName MEDIABOX = new PdfName("/MediaBox", 0);
/** This is a static final PdfName */
public static final PdfName MODDATE = new PdfName("/ModDate", 0);
/** This is a static final PdfName */
public static final PdfName NAME = new PdfName("/Name", 0);
/** This is a static final PdfName */
public static final PdfName NAMES = new PdfName("/Names", 0);
/** This is a static final PdfName */
public static final PdfName NEXT = new PdfName("/Next", 0);
/** This is a static final PdfName */
public static final PdfName NONFULLSCREENPAGEMODE = new PdfName("/NonFullScreenPageMode", 0);
/** This is a static final PdfName */
public static final PdfName O = new PdfName("/O", 0);
/** This is a static final PdfName */
public static final PdfName ONECOLUMN = new PdfName("/OneColumn", 0);
/** This is a static final PdfName */
public static final PdfName OPENACTION = new PdfName("/OpenAction", 0);
/** This is a static final PdfName */
public static final PdfName ORDERING = new PdfName("/Ordering", 0);
/** This is a static final PdfName */
public static final PdfName OUTLINES = new PdfName("/Outlines", 0);
/** This is a static final PdfName */
public static final PdfName P = new PdfName("/P", 0);
/** This is a static final PdfName */
public static final PdfName PAGE = new PdfName("/Page", 0);
/** This is a static final PdfName */
public static final PdfName PAGELABELS = new PdfName("/PageLabels", 0);
/** This is a static final PdfName */
public static final PdfName PAGELAYOUT = new PdfName("/PageLayout", 0);
/** This is a static final PdfName */
public static final PdfName PAGEMODE = new PdfName("/PageMode", 0);
/** This is a static final PdfName */
public static final PdfName PAGES = new PdfName("/Pages", 0);
/** This is a static final PdfName */
public static final PdfName PANOSE = new PdfName("/Panose", 0);
/** This is a static final PdfName */
public static final PdfName PARENT = new PdfName("/Parent", 0);
/** This is a static final PdfName */
public static final PdfName PATTERN = new PdfName("/Pattern", 0);
/** This is a static final PdfName */
public static final PdfName PDF = new PdfName("/PDF", 0);
/** This is a static final PdfName */
public static final PdfName PREDICTOR = new PdfName("/Predictor", 0);
/** This is a static final PdfName */
public static final PdfName PREV = new PdfName("/Prev", 0);
/** This is a static final PdfName */
public static final PdfName PROCSET = new PdfName("/ProcSet", 0);
/** This is a static final PdfName */
public static final PdfName PRODUCER = new PdfName("/Producer", 0);
/** This is a static final PdfName */
public static final PdfName PROPERTIES = new PdfName("/Properties", 0);
/** This is a static final PdfName */
public static final PdfName R = new PdfName("/R", 0);
/** This is a static final PdfName */
public static final PdfName R2L = new PdfName("/R2L", 0);
/** This is a static final PdfName */
public static final PdfName RECT = new PdfName("/Rect", 0);
/** This is a static final PdfName */
public static final PdfName REGISTRY = new PdfName("/Registry", 0);
/** This is a static final PdfName */
public static final PdfName RESOURCES = new PdfName("/Resources", 0);
/** This is a static final PdfName */
public static final PdfName ROOT = new PdfName("/Root", 0);
/** This is a static final PdfName */
public static final PdfName ROTATE = new PdfName("/Rotate", 0);
/** This is a static final PdfName */
public static final PdfName ROWS = new PdfName("/Rows", 0);
/** This is a static final PdfName */
public static final PdfName RUNLENGTHDECODE = new PdfName("/RunLengthDecode", 0);
/** This is a static final PdfName */
public static final PdfName S = new PdfName("/S", 0);
/** This is a static final PdfName */
public static final PdfName SINGLEPAGE = new PdfName("/SinglePage", 0);
/** This is a static final PdfName */
public static final PdfName SIZE = new PdfName("/Size", 0);
/** This is a static final PdfName */
public static final PdfName STANDARD = new PdfName("/Standard", 0);
/** This is a static final PdfName */
public static final PdfName SUBJECT = new PdfName("/Subject", 0);
/** This is a static final PdfName */
public static final PdfName SUBTYPE = new PdfName("/Subtype", 0);
/** This is a static final PdfName */
public static final PdfName SUPPLEMENT = new PdfName("/Supplement", 0);
/** This is a static final PdfName of a base 14 type 1 font */
public static final PdfName SYMBOL = new PdfName("/Symbol", 0);
/** This is a static final PdfName */
public static final PdfName T = new PdfName("/T", 0);
/** This is a static final PdfName */
public static final PdfName TEXT = new PdfName("/Text", 0);
/** This is a static final PdfName */
public static final PdfName THUMB = new PdfName("/Thumb", 0);
/** This is a static final PdfName */
public static final PdfName THREADS = new PdfName("/Threads", 0);
/** This is a static final PdfName of a base 14 type 1 font */
public static final PdfName TIMES_ROMAN = new PdfName("/Times-Roman", 0);
/** This is a static final PdfName of a base 14 type 1 font */
public static final PdfName TIMES_BOLD = new PdfName("/Times-Bold", 0);
/** This is a static final PdfName of a base 14 type 1 font */
public static final PdfName TIMES_ITALIC = new PdfName("/Times-Italic", 0);
/** This is a static final PdfName of a base 14 type 1 font */
public static final PdfName TIMES_BOLDITALIC = new PdfName("/Times-BoldItalic", 0);
/** This is a static final PdfName */
public static final PdfName TITLE = new PdfName("/Title", 0);
/** This is a static final PdfName */
public static final PdfName TRANS = new PdfName("/Trans", 0);
/** This is a static final PdfName */
public static final PdfName TWOCOLUMNLEFT = new PdfName("/TwoColumnLeft", 0);
/** This is a static final PdfName */
public static final PdfName TWOCOLUMNRIGHT = new PdfName("/TwoColumnRight", 0);
/** This is a static final PdfName */
public static final PdfName TYPE = new PdfName("/Type", 0);
/** This is a static final PdfName */
public static final PdfName TYPE1 = new PdfName("/Type1", 0);
/** This is a static final PdfName of an attribute. */
public static final PdfName U = new PdfName("/U", 0);
/** This is a static final PdfName */
public static final PdfName URI = new PdfName("/URI", 0);
/** This is a static final PdfName */
public static final PdfName USENONE = new PdfName("/UseNone", 0);
/** This is a static final PdfName */
public static final PdfName USEOUTLINES = new PdfName("/UseOutlines", 0);
/** This is a static final PdfName */
public static final PdfName USETHUMBS = new PdfName("/UseThumbs", 0);
/** This is a static final PdfName */
public static final PdfName V = new PdfName("/V", 0);
/** This is a static final PdfName */
public static final PdfName VIEWERPREFERENCES = new PdfName("/ViewerPreferences", 0);
/** This is a static final PdfName of an attribute. */
public static final PdfName W = new PdfName("/W", 0);
/** This is a static final PdfName of an attribute. */
public static final PdfName WIDTH = new PdfName("/Width", 0);
/** This is a static final PdfName */
public static final PdfName WIDTHS = new PdfName("/Widths", 0);
/** This is a static final PdfName of an encoding */
public static final PdfName WIN_ANSI_ENCODING = new PdfName("/WinAnsiEncoding", 0);
/** This is a static final PdfName */
public static final PdfName XOBJECT = new PdfName("/XObject", 0);
/** This is a static final PdfName */
public static final PdfName XYZ = new PdfName("/XYZ", 0);
/** This is a static final PdfName of a base 14 type 1 font */
public static final PdfName ZAPFDINGBATS = new PdfName("/ZapfDingbats", 0);
// constructors
/**
* Constructs a <CODE>PdfName</CODE>-object.
*
* @param name the new Name.
* @exception BadPdfFormatException gets thrown when the name is too long or an illegal character is used.
*/
PdfName(String name) throws BadPdfFormatException {
super(PdfObject.NAME, name);
// The minimum number of characters in a name is 1, the maximum is 127 (the '/' not included)
if (bytes.length < 1 || bytes.length > 127) {
throw new BadPdfFormatException("The name is too long (" + bytes.length + " characters).");
}
// The name has to be checked for illegal characters
int length = name.length();
for (int i = 0; i < length; i++) {
if (name.charAt(i) < 32 || name.charAt(i) > 255) {
throw new BadPdfFormatException("Illegal character on position " + i + ".");
}
}
// every special character has to be substituted
StringBuffer pdfName = new StringBuffer("/");
char character;
// loop over all the characters
for (int index = 0; index < length; index++) {
character = name.charAt(index);
// special characters are escaped (reference manual p.39)
switch (character) {
case ' ':
case '%':
case '(':
case ')':
case '<':
case '>':
case '[':
case ']':
case '{':
case '}':
case '/':
case '#':
pdfName.append('#');
pdfName.append(Integer.toString((int) character, 16));
break;
default:
pdfName.append(character);
}
}
setContent(pdfName.toString());
}
/**
* Constructs a <CODE>PdfName</CODE>-object that doesn't throw a BadPdfFormatException.
* <P>
* This extra private constructor was needed to be able to construct final static names.
*
* @param name the new Name.
* @param dummy a dummy variable
*/
private PdfName(String name, int dummy) {
super(PdfObject.NAME, name);
}
// methods
/**
* Compares the names alfabetically.
*
* @param object an object of the type PdfName
* @return the value 0 if the object is a name equal to the name of this object,
* a value less than 0 if the argument's name is greater than the name of this object,
* a value greater than 0 if the argument's name is less than the name of this object
* @throws a <CODE>ClassCastException</CODE> if the argument is not a PdfName
*
*/
public final int compareTo(Object object) {
PdfName name = (PdfName) object;
// BEGIN: changes by lauerc@gmx.de
// Byte array to String conversion is damned slow in JAVA, this implementation makes PDF genearation perform
// more than 20 % faster!
//return toString().compareTo(name.toString()); // removed performance killer
byte myBytes[] = bytes;
byte objBytes[] = name.bytes;
if(myBytes.length > objBytes.length)
return 1;
if(objBytes.length > myBytes.length)
return -1;
for(int i=0; i<myBytes.length; i++) {
if(myBytes[i] > objBytes[i])
return 1;
if(myBytes[i] < objBytes[i])
return -1;
}
return 0;
// END: changes by lauerc@gmx.de
}
/**
* Returns the <CODE>String</CODE> value of this <CODE>PdfName</CODE>.
*
* @return a <CODE>String</CODE>
*/
public final String toString() {
try {
return new String(bytes, PdfObject.ENCODING);
}
catch (Exception e) {
return new String(bytes);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -