Class PdfFileSpecification
java.lang.Object
com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfObject
com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfDictionary
com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfFileSpecification
Specifies a file or an URL. The file can be extern or embedded.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PdfFileSpecification
fileEmbedded
(PdfWriter writer, String filePath, String fileDisplay, byte[] fileStore) Creates a file specification with the file embedded.static PdfFileSpecification
fileEmbedded
(PdfWriter writer, String filePath, String fileDisplay, byte[] fileStore, boolean compress) Creates a file specification with the file embedded.static PdfFileSpecification
fileExtern
(PdfWriter writer, String filePath) Creates a file specification for an external file.Gets the indirect reference to this file specification.static PdfFileSpecification
Creates a file specification of type URL.Methods inherited from class com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfDictionary
contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isDictionaryType, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putDel, putEx, remove, size, toPdf
Methods inherited from class com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, toString, type
-
Field Details
-
writer
-
ref
-
-
Constructor Details
-
PdfFileSpecification
public PdfFileSpecification()Creates a new instance of PdfFileSpecification. The static methods are preferred.
-
-
Method Details
-
url
Creates a file specification of type URL.- Parameters:
writer
- thePdfWriter
url
- the URL- Returns:
- the file specification
-
fileEmbedded
public static PdfFileSpecification fileEmbedded(PdfWriter writer, String filePath, String fileDisplay, byte[] fileStore) throws IOException Creates a file specification with the file embedded. The file may come from the file system or from a byte array. The data is flate compressed.- Parameters:
writer
- thePdfWriter
filePath
- the file pathfileDisplay
- the file information that is presented to the userfileStore
- the byte array with the file. If it is notnull
it takes precedence overfilePath
- Returns:
- the file specification
- Throws:
IOException
- on error
-
fileEmbedded
public static PdfFileSpecification fileEmbedded(PdfWriter writer, String filePath, String fileDisplay, byte[] fileStore, boolean compress) throws IOException Creates a file specification with the file embedded. The file may come from the file system or from a byte array.- Parameters:
writer
- thePdfWriter
filePath
- the file pathfileDisplay
- the file information that is presented to the userfileStore
- the byte array with the file. If it is notnull
it takes precedence overfilePath
compress
- sets the compression on the data. Multimedia content will benefit little from compression- Returns:
- the file specification
- Throws:
IOException
- on error
-
fileExtern
Creates a file specification for an external file.- Parameters:
writer
- thePdfWriter
filePath
- the file path- Returns:
- the file specification
-
getReference
Gets the indirect reference to this file specification. Multiple invocations will retrieve the same value.- Returns:
- the indirect reference
- Throws:
IOException
- on error
-