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.- Author:
- Paulo Soares (psoares@consiste.pt)
-
-
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 PdfFileSpecificationfileEmbedded(PdfWriter writer, String filePath, String fileDisplay, byte[] fileStore)Creates a file specification with the file embedded.static PdfFileSpecificationfileEmbedded(PdfWriter writer, String filePath, String fileDisplay, byte[] fileStore, boolean compress)Creates a file specification with the file embedded.static PdfFileSpecificationfileExtern(PdfWriter writer, String filePath)Creates a file specification for an external file.PdfIndirectReferencegetReference()Gets the indirect reference to this file specification.static PdfFileSpecificationurl(PdfWriter writer, 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, String url)
Creates a file specification of type URL.- Parameters:
writer- thePdfWriterurl- 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- thePdfWriterfilePath- the file pathfileDisplay- the file information that is presented to the userfileStore- the byte array with the file. If it is notnullit 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- thePdfWriterfilePath- the file pathfileDisplay- the file information that is presented to the userfileStore- the byte array with the file. If it is notnullit takes precedence overfilePathcompress- sets the compression on the data. Multimedia content will benefit little from compression- Returns:
- the file specification
- Throws:
IOException- on error
-
fileExtern
public static PdfFileSpecification fileExtern(PdfWriter writer, String filePath)
Creates a file specification for an external file.- Parameters:
writer- thePdfWriterfilePath- the file path- Returns:
- the file specification
-
getReference
public PdfIndirectReference getReference() throws IOException
Gets the indirect reference to this file specification. Multiple invocations will retrieve the same value.- Returns:
- the indirect reference
- Throws:
IOException- on error
-
-