FileDocCategorySizeDatePackage
PDFDict.javaAPI DocExample1302Sun Feb 08 21:34:02 GMT 2004com.darwinsys.spdf

PDFDict

public abstract class PDFDict extends PDFObject
A PDFDict ias a PDFObject that is all, or mostly, a Dictionary.
author
Ian Darwin, http://www.darwinsys.com/

Fields Summary
protected Hashtable
dict
The Dictionary is a HashTable. Put the keys without a leading slash, since they always have it. Values can be /names, (strings), or whatever.
Constructors Summary
PDFDict(PDF m)

		super(m);
		dict = new Hashtable();
	
Methods Summary
protected voidendObj()

		master.println("endobj");
	
protected voidprint()
Write the object to the Output Writer. The default implementation of this method in PDFDict just calls startObj, printDict, and endObj.

		startObj();
		printDict();
		endObj();
	
protected voidprintDict()

		master.println("<<");
		Enumeration enum = dict.keys();
		while (enum.hasMoreElements()) {
			master.print("\t/");
			String key = (String)enum.nextElement();
			master.print(key);
			master.print(" ");
			master.print(dict.get(key));
			master.println();
		}
		master.println(">>");
	
protected voidstartObj()

		// Record the starting position of this Obj in the xref table
		master.addXref();

		// Print out e.g., "42 0 obj"
		master.print(master.currObj++);
	 	master.print(" 0 obj");
		master.println();