Package com.itextpdf.kernel.pdf.filespec
Class PdfFileSpec
- Direct Known Subclasses:
-
PdfDictionaryFS,PdfStringFS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PdfFileSpeccreateEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String fileDisplay, PdfDictionary fileParameter, PdfName afRelationshipValue) Create an embedded file specification.static PdfFileSpeccreateEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String fileDisplay, PdfName afRelationshipValue) Create an embedded file specification.static PdfFileSpeccreateEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String description, String fileDisplay, PdfDictionary fileParameter, PdfName afRelationshipValue) Create an embedded file specification.static PdfFileSpeccreateEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String description, String fileDisplay, PdfName afRelationshipValue) Create an embedded file specification.static PdfFileSpeccreateEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String description, String fileDisplay, PdfName mimeType, PdfDictionary fileParameter, PdfName afRelationshipValue) Create an embedded file specification.static PdfFileSpeccreateEmbeddedFileSpec(PdfDocument doc, InputStream is, String description, String fileDisplay, PdfName mimeType, PdfDictionary fileParameter, PdfName afRelationshipValue) Create an embedded file specification.static PdfFileSpeccreateEmbeddedFileSpec(PdfDocument doc, InputStream is, String description, String fileDisplay, PdfName mimeType, PdfName afRelationshipValue) Create an embedded file specification.static PdfFileSpeccreateEmbeddedFileSpec(PdfDocument doc, String filePath, String fileDisplay, PdfName afRelationshipValue) Create an embedded file specification.static PdfFileSpeccreateEmbeddedFileSpec(PdfDocument doc, String filePath, String description, String fileDisplay, PdfName afRelationshipValue) Create an embedded file specification.static PdfFileSpeccreateEmbeddedFileSpec(PdfDocument doc, String filePath, String description, String fileDisplay, PdfName mimeType, PdfDictionary fileParameter, PdfName afRelationshipValue) Create an embedded file specification.static PdfFileSpeccreateEmbeddedFileSpec(PdfDocument doc, String filePath, String description, String fileDisplay, PdfName mimeType, PdfName afRelationshipValue) Create an embedded file specification.static PdfFileSpeccreateExternalFileSpec(PdfDocument doc, String filePath) Create an external file specification.static PdfFileSpeccreateExternalFileSpec(PdfDocument doc, String filePath, PdfName afRelationshipValue) Create an external file specification.PDF 2.0.protected booleanDefines if the object behind this wrapper must be an indirect object in the resultant document.setFileIdentifier(PdfArray fileIdentifier) setThumbnailImage(PdfImageXObject thumbnailImage) PDF 2.0.setVolatile(PdfBoolean isVolatile) static PdfFileSpecwrapFileSpecObject(PdfObject fileSpecObject) Wrap the passedPdfObjectto the specificPdfFileSpecobject, according to the type of the passed pdf object.Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
Constructor Details
-
PdfFileSpec
-
-
Method Details
-
wrapFileSpecObject
Wrap the passedPdfObjectto the specificPdfFileSpecobject, according to the type of the passed pdf object.- Parameters:
-
fileSpecObject- object to wrap - Returns:
-
wrapped
PdfFileSpecinstance
-
createExternalFileSpec
public static PdfFileSpec createExternalFileSpec(PdfDocument doc, String filePath, PdfName afRelationshipValue) Create an external file specification.- Parameters:
-
doc-PdfDocumentinstance to make this file specification indirect -
filePath- file specification string, describing the path to the external file -
afRelationshipValue- value that represents the relationship between the component of the passed PDF document that refers to this file specification and the associated file. Ifnull,PdfName.Unspecifiedwill be added. - Returns:
-
PdfFileSpeccontaining the file specification of the file
-
createExternalFileSpec
Create an external file specification.- Parameters:
-
doc-PdfDocumentinstance to make this file specification indirect -
filePath- file specification string, describing the path to the external file - Returns:
-
PdfFileSpeccontaining the file specification of the file
-
createEmbeddedFileSpec
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String description, String fileDisplay, PdfName mimeType, PdfDictionary fileParameter, PdfName afRelationshipValue) Create an embedded file specification.- Parameters:
-
doc-PdfDocumentinstance to make this file specification indirect -
fileStore- byte[] containing the file -
description- file description -
fileDisplay- actual file name stored in the pdf -
mimeType- subtype of the embedded file. The value of this entry shall conform to the MIME media type names -
fileParameter-PdfDictionarycontaining fil parameters -
afRelationshipValue- value that represents the relationship between the component of the passed PDF document that refers to this file specification and the associated file. Ifnull,PdfName.Unspecifiedwill be added. - Returns:
-
PdfFileSpeccontaining the file specification of the file
-
createEmbeddedFileSpec
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String description, String fileDisplay, PdfDictionary fileParameter, PdfName afRelationshipValue) Create an embedded file specification.- Parameters:
-
doc-PdfDocumentinstance to make this file specification indirect -
fileStore- byte[] containing the file -
fileDisplay- actual file name stored in the pdf -
fileParameter-PdfDictionarycontaining fil parameters -
afRelationshipValue- value that represents the relationship between the component of the passed PDF document that refers to this file specification and the associated file. Ifnull,PdfName.Unspecifiedwill be added. -
description- the file description - Returns:
-
PdfFileSpeccontaining the file specification of the file
-
createEmbeddedFileSpec
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String fileDisplay, PdfDictionary fileParameter, PdfName afRelationshipValue) Create an embedded file specification.- Parameters:
-
doc-PdfDocumentinstance to make this file specification indirect -
fileStore- byte[] containing the file -
fileDisplay- actual file name stored in the pdf -
fileParameter-PdfDictionarycontaining fil parameters -
afRelationshipValue- value that represents the relationship between the component of the passed PDF document that refers to this file specification and the associated file. Ifnull,PdfName.Unspecifiedwill be added. - Returns:
-
PdfFileSpeccontaining the file specification of the file
-
createEmbeddedFileSpec
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String fileDisplay, PdfName afRelationshipValue) Create an embedded file specification.- Parameters:
-
doc-PdfDocumentinstance to make this file specification indirect -
fileStore- byte[] containing the file -
fileDisplay- actual file name stored in the pdf -
afRelationshipValue- value that represents the relationship between the component of the passed PDF document that refers to this file specification and the associated file. Ifnull,PdfName.Unspecifiedwill be added. - Returns:
-
PdfFileSpeccontaining the file specification of the file
-
createEmbeddedFileSpec
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String description, String fileDisplay, PdfName afRelationshipValue) Create an embedded file specification.- Parameters:
-
doc-PdfDocumentinstance to make this file specification indirect -
fileStore- byte[] containing the file -
description- file description -
fileDisplay- actual file name stored in the pdf -
afRelationshipValue- value that represents the relationship between the component of the passed PDF document that refers to this file specification and the associated file. Ifnull,PdfName.Unspecifiedwill be added. - Returns:
-
PdfFileSpeccontaining the file specification of the file
-
createEmbeddedFileSpec
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, String filePath, String description, String fileDisplay, PdfName mimeType, PdfDictionary fileParameter, PdfName afRelationshipValue) throws IOException Create an embedded file specification.- Parameters:
-
doc-PdfDocumentinstance to make this file specification indirect -
filePath- file specification string, describing the path to the file to embed -
description- file description -
fileDisplay- actual file name stored in the pdf -
mimeType- subtype of the embedded file. The value of this entry shall conform to the MIME media type names -
fileParameter- dictionary with file parameters -
afRelationshipValue- value that represents the relationship between the component of the passed PDF document that refers to this file specification and the associated file. Ifnull,PdfName.Unspecifiedwill be added. - Returns:
-
PdfFileSpeccontaining the file specification of the file - Throws:
-
IOException- if there are errors while creating an URL from the passed file path.
-
createEmbeddedFileSpec
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, String filePath, String description, String fileDisplay, PdfName mimeType, PdfName afRelationshipValue) throws IOException Create an embedded file specification.- Parameters:
-
doc-PdfDocumentinstance to make this file specification indirect -
filePath- file specification string, describing the path to the file to embed -
description- file description -
fileDisplay- actual file name stored in the pdf -
mimeType- subtype of the embedded file. The value of this entry shall conform to the MIME media type names -
afRelationshipValue- value that represents the relationship between the component of the passed PDF document that refers to this file specification and the associated file. Ifnull,PdfName.Unspecifiedwill be added. - Returns:
-
PdfFileSpeccontaining the file specification of the file - Throws:
-
IOException- if there are errors while creating an URL from the passed file path.
-
createEmbeddedFileSpec
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, String filePath, String description, String fileDisplay, PdfName afRelationshipValue) throws IOException Create an embedded file specification.- Parameters:
-
doc-PdfDocumentinstance to make this file specification indirect -
filePath- file specification string, describing the path to the file to embed -
description- file description -
fileDisplay- actual file name stored in the pdf -
afRelationshipValue- value that represents the relationship between the component of the passed PDF document that refers to this file specification and the associated file. Ifnull,PdfName.Unspecifiedwill be added. - Returns:
-
PdfFileSpeccontaining the file specification of the file - Throws:
-
IOException- if there are errors while creating an URL from the passed file path.
-
createEmbeddedFileSpec
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, String filePath, String fileDisplay, PdfName afRelationshipValue) throws IOException Create an embedded file specification.- Parameters:
-
doc-PdfDocumentinstance to make this file specification indirect -
filePath- path to the file to embed -
fileDisplay- actual file name stored in the pdf -
afRelationshipValue- value that represents the relationship between the component of the passed PDF document that refers to this file specification and the associated file. Ifnull,PdfName.Unspecifiedwill be added. - Returns:
-
PdfFileSpeccontaining the file specification of the file - Throws:
-
IOException- if there are errors while creating an URL from the passed file path.
-
createEmbeddedFileSpec
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, InputStream is, String description, String fileDisplay, PdfName mimeType, PdfDictionary fileParameter, PdfName afRelationshipValue) Create an embedded file specification.- Parameters:
-
doc-PdfDocumentinstance to make this file specification indirect -
is- stream containing the file to embed -
description- file description -
fileDisplay- actual file name stored in the pdf -
mimeType- subtype of the embedded file. The value of this entry shall conform to the MIME media type names -
fileParameter- dictionary with file parameters -
afRelationshipValue- value that represents the relationship between the component of the passed PDF document that refers to this file specification and the associated file. Ifnull,PdfName.Unspecifiedwill be added. - Returns:
-
PdfFileSpeccontaining the file specification of the file
-
createEmbeddedFileSpec
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, InputStream is, String description, String fileDisplay, PdfName mimeType, PdfName afRelationshipValue) Create an embedded file specification.- Parameters:
-
doc-PdfDocumentinstance to make this file specification indirect -
is- stream containing the file to embed -
description- file description -
fileDisplay- actual file name stored in the pdf -
mimeType- subtype of the embedded file. The value of this entry shall conform to the MIME media type names -
afRelationshipValue- value that represents the relationship between the component of the passed PDF document that refers to this file specification and the associated file. Ifnull,PdfName.Unspecifiedwill be added. - Returns:
-
PdfFileSpeccontaining the file specification of the file
-
setFileIdentifier
-
getFileIdentifier
-
setVolatile
-
isVolatile
-
setCollectionItem
-
setThumbnailImage
PDF 2.0. Sets a stream object defining the thumbnail image for the file specification.- Parameters:
-
thumbnailImage- image used as a thumbnail - Returns:
-
this
PdfFileSpecinstance
-
getThumbnailImage
PDF 2.0. Gets a stream object defining the thumbnail image for the file specification.- Returns:
-
image used as a thumbnail, or
nullif it is not set
-
put
-
isWrappedObjectMustBeIndirect
protected boolean isWrappedObjectMustBeIndirect()Description copied from class:PdfObjectWrapperDefines if the object behind this wrapper must be an indirect object in the resultant document.
If this method returns true it doesn't necessarily mean that object must be in the indirect state at any moment, but rather defines that when the object will be written to the document it will be transformed into indirect object if it's not indirect yet.
Return value of this method shouldn't depend on any logic, it should return always true or false.- Specified by:
-
isWrappedObjectMustBeIndirectin classPdfObjectWrapper<PdfObject> - Returns:
- true if in the resultant document the object behind the wrapper must be indirect, otherwise false.
-