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
-
public class PdfFileSpecification extends PdfDictionary
Specifies a file or an URL. The file can be extern or embedded.
-
-
Constructor Summary
Constructors Constructor Description PdfFileSpecification()
Creates a new instance of PdfFileSpecification.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PdfFileSpecification
fileEmbedded(PdfWriter writer, java.lang.String filePath, java.lang.String fileDisplay, byte[] fileStore)
Creates a file specification with the file embedded.static PdfFileSpecification
fileEmbedded(PdfWriter writer, java.lang.String filePath, java.lang.String fileDisplay, byte[] fileStore, boolean compress)
Creates a file specification with the file embedded.static PdfFileSpecification
fileExtern(PdfWriter writer, java.lang.String filePath)
Creates a file specification for an external file.PdfIndirectReference
getReference()
Gets the indirect reference to this file specification.static PdfFileSpecification
url(PdfWriter writer, java.lang.String url)
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 Detail
-
writer
protected PdfWriter writer
-
ref
protected PdfIndirectReference ref
-
-
Method Detail
-
url
public static PdfFileSpecification url(PdfWriter writer, java.lang.String 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, java.lang.String filePath, java.lang.String fileDisplay, byte[] fileStore) throws java.io.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:
java.io.IOException
- on error
-
fileEmbedded
public static PdfFileSpecification fileEmbedded(PdfWriter writer, java.lang.String filePath, java.lang.String fileDisplay, byte[] fileStore, boolean compress) throws java.io.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:
java.io.IOException
- on error
-
fileExtern
public static PdfFileSpecification fileExtern(PdfWriter writer, java.lang.String filePath)
Creates a file specification for an external file.- Parameters:
writer
- thePdfWriter
filePath
- the file path- Returns:
- the file specification
-
getReference
public PdfIndirectReference getReference() throws java.io.IOException
Gets the indirect reference to this file specification. Multiple invocations will retrieve the same value.- Returns:
- the indirect reference
- Throws:
java.io.IOException
- on error
-
-