File: PdfCollection.java

package info (click to toggle)
libitext-java 2.1.7-11
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,624 kB
  • ctags: 15,568
  • sloc: java: 94,208; xml: 1,049; sh: 15; makefile: 8
file content (66 lines) | stat: -rw-r--r-- 1,639 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.lowagie.text.pdf.collection;

import com.lowagie.text.pdf.PdfDictionary;
import com.lowagie.text.pdf.PdfName;
import com.lowagie.text.pdf.PdfString;

public class PdfCollection extends PdfDictionary {

	/** A type of PDF Collection */
	public static final int DETAILS = 0;
	/** A type of PDF Collection */
	public static final int TILE = 1;
	/** A type of PDF Collection */
	public static final int HIDDEN = 2;
	
	/**
	 * Constructs a PDF Collection.
	 * @param	type	the type of PDF collection.
	 */
	public PdfCollection(int type) {
		super(PdfName.COLLECTION);
		switch(type) {
		case TILE:
			put(PdfName.VIEW, PdfName.T);
			break;
		case HIDDEN:
			put(PdfName.VIEW, PdfName.H);
			break;
		default:
			put(PdfName.VIEW, PdfName.D);
		}
	}
	
	/**
	 * Identifies the document that will be initially presented
	 * in the user interface.
	 * @param description	the description that was used when attaching the file to the document
	 */
	public void setInitialDocument(String description) {
		put(PdfName.D, new PdfString(description, null));
	}
	
	/**
	 * Sets the Collection schema dictionary.
	 * @param schema	an overview of the collection fields
	 */
	public void setSchema(PdfCollectionSchema schema) {
		put(PdfName.SCHEMA, schema);
	}
	
	/**
	 * Gets the Collection schema dictionary.
	 * @return schema	an overview of the collection fields
	 */
	public PdfCollectionSchema getSchema() {
		return (PdfCollectionSchema)get(PdfName.SCHEMA);
	}
	
	/**
	 * Sets the Collection sort dictionary.
	 * @param sort	a collection sort dictionary
	 */
	public void setSort(PdfCollectionSort sort) {
		put(PdfName.SORT, sort);
	}
}