com.spire.pdf.collections
Class PdfCollection

java.lang.Object
  extended by com.spire.pdf.collections.PdfCollection

public class PdfCollection
extends java.lang.Object

A collection specifies the viewing and organizational characteristics of portable collections.The intent of portable collections is to present, sort, and search collections of related document,such as email archives, photo collections, and engineering bidsets.


Nested Class Summary
static class PdfCollection.CustomFieldType
          Custom field type.
static class PdfCollection.FileRelatedFieldType
          File related field Type.
 
Method Summary
 void addAttachment(PdfAttachment attachment)
          Add an attachment.
 void addCustomField(java.lang.String fieldName, java.lang.String displayText, PdfCollection.CustomFieldType fieldType)
          Add a custom field.
 void addFile(java.lang.String filePath)
          Add a local file.
 void addFile(java.lang.String fileName, java.io.InputStream stream)
          Add a stream.
 void addFileRelatedField(java.lang.String fieldName, java.lang.String displayText, PdfCollection.FileRelatedFieldType fieldType)
          Add a file related field.
 void clear()
          Clear all files and folders.
 java.util.List<PdfAttachment> getAssociatedFiles()
          Get the document collection associated files
 java.util.List getFieldNames()
          Get the document collection associated field names
 PdfFolder getFolders()
           
 void sort(java.lang.String[] fieldNames, boolean[] order)
          Sort embedded files with field names.
 

Method Detail

getFolders

public PdfFolder getFolders()
Returns:
(Required if the collection has folders; ExtensionLevel3) An indirect reference to the folder dictionary that is the single common ancestor of all other folders in a portable collection.

getAssociatedFiles

public java.util.List<PdfAttachment> getAssociatedFiles()
Get the document collection associated files

Returns:

getFieldNames

public java.util.List getFieldNames()
Get the document collection associated field names

Returns:

addFile

public void addFile(java.lang.String filePath)
Add a local file.

Parameters:
filePath - The local file path.

addFile

public void addFile(java.lang.String fileName,
                    java.io.InputStream stream)
Add a stream.

Parameters:
fileName - The file name of the stream.
stream - The stream.

addAttachment

public void addAttachment(PdfAttachment attachment)
Add an attachment.

Parameters:
attachment - The attachment.

addCustomField

public void addCustomField(java.lang.String fieldName,
                           java.lang.String displayText,
                           PdfCollection.CustomFieldType fieldType)
Add a custom field.

Parameters:
fieldName - Custom field name.
displayText - Custom field display name.
fieldType - Custom field type.

addFileRelatedField

public void addFileRelatedField(java.lang.String fieldName,
                                java.lang.String displayText,
                                PdfCollection.FileRelatedFieldType fieldType)
Add a file related field.

Parameters:
fieldName - File related field name.
displayText - File related field display name.
fieldType - File related field type.

sort

public void sort(java.lang.String[] fieldNames,
                 boolean[] order)
Sort embedded files with field names.

Parameters:
fieldNames - The names of fields that the PDF viewer application uses to sort the items in the collection.
order - Specifies whether the items in the collection are sorted in ascending order.

clear

public void clear()
Clear all files and folders.

Throws:
java.lang.Exception