Package com.datalogics.PDFL
Class FileAttachment
java.lang.Object
com.datalogics.PDFL.FileAttachment
A file attachment. Any file can be attached to the PDF document. The class allows to create attachment and manipulate by its content.
-
Constructor Summary
ConstructorsConstructorDescriptionFileAttachment(Document doc, String fileName) Allows to add attachment into the PDF document.FileAttachment(Document doc, String fileName, String keyName) Allows to add attachment into the PDF document using the specified key name. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()floatgetCollectionItemNumber(CollectionSchemaField collectionField) GetCollectionItemNumber allows to obtain collection item according to the specified schema field.getCollectionItemString(CollectionSchemaField collectionField) GetCollectionItemString allows to obtain collection item value according to the specified schema field.Allow to obtain attachment's file name.longAllows to obtain attachment's size.voidsaveToFile(String fileName) Allows to save attachment to the specified file.voidsaveToStream(ImageOutputStream stream) Saves a FileAttachment to a javax.imageio.stream.ImageInputStream.voidsetCollectionItemNumber(CollectionSchemaField collectionField, float value) SetCollectionItemNumber allows to add key to the collection item dictionary.voidsetCollectionItemString(CollectionSchemaField collectionField, String value) SetCollectionItemString allows to add key to the collection item dictionary.voidupdateFromFile(String fileName) Allows to update attachment from another file.
-
Constructor Details
-
FileAttachment
Allows to add attachment into the PDF document.- Parameters:
doc- The PDF document (reference).fileName- The path to file which will be attached to the document.
-
FileAttachment
Allows to add attachment into the PDF document using the specified key name.- Parameters:
doc- The PDF document (reference).fileName- The path to file which will be attached to the document.keyName- The name of the key.
-
-
Method Details
-
delete
public void delete() -
saveToStream
Saves a FileAttachment to a javax.imageio.stream.ImageInputStream.- Parameters:
stream- The stream from which to save the FileAttachment.- Throws:
IOException
-
saveToFile
Allows to save attachment to the specified file.- Parameters:
fileName- The path where attachment will be saved.
-
updateFromFile
Allows to update attachment from another file.- Parameters:
fileName- The path to the file from which attachment will be updated.
-
getFileSize
public long getFileSize()Allows to obtain attachment's size.- Returns:
- The attachment's size in bytes.
-
getFileName
Allow to obtain attachment's file name.- Returns:
- The attachment's file name.
-
setCollectionItemNumber
SetCollectionItemNumber allows to add key to the collection item dictionary.- Parameters:
collectionField- schema field which contains information about data type. The parameter's subtype should be a Number.value- the item's value.
-
getCollectionItemNumber
GetCollectionItemNumber allows to obtain collection item according to the specified schema field.- Parameters:
collectionField- the field for which item value should be retrieved.- Returns:
- collection items value
-
setCollectionItemString
SetCollectionItemString allows to add key to the collection item dictionary.- Parameters:
collectionField- schema field which contains information about data type. The parameter's subtype should be a Text.value- the item's value.
-
getCollectionItemString
GetCollectionItemString allows to obtain collection item value according to the specified schema field.- Parameters:
collectionField- the field for which item value should be retrieved.- Returns:
- collection items value
-