Class PdfFileSpecification
- Namespace
- iTextSharp.text.pdf
- Assembly
- iTextSharp.LGPLv2.Core.dll
Specifies a file or an URL. The file can be extern or embedded. @author Paulo Soares (psoares@consiste.pt)
public class PdfFileSpecification : PdfDictionary
- Inheritance
-
PdfFileSpecification
- Inherited Members
Constructors
PdfFileSpecification()
Creates a new instance of PdfFileSpecification. The static methods are preferred.
public PdfFileSpecification()
Fields
Refi
protected PdfIndirectReference Refi
Field Value
Writer
protected PdfWriter Writer
Field Value
Properties
MultiByteFileName
Sets the file name (the key /F) string as an hex representation to support multi byte file names. The name must have the slash and backslash escaped according to the file specification rules
public byte[] MultiByteFileName { set; }
Property Value
- byte[]
Reference
Gets the indirect reference to this file specification. Multiple invocations will retrieve the same value. @throws IOException on error
public PdfIndirectReference Reference { get; }
Property Value
- PdfIndirectReference
the indirect reference
Volatile
Sets a flag that indicates whether an external file referenced by the file specification is volatile. If the value is true, applications should never cache a copy of the file.
public bool Volatile { set; }
Property Value
Methods
AddCollectionItem(PdfCollectionItem)
Adds the Collection item dictionary.
public void AddCollectionItem(PdfCollectionItem ci)
Parameters
AddDescription(string, bool)
Adds a description for the file that is specified here.
public void AddDescription(string description, bool unicode)
Parameters
FileEmbedded(PdfWriter, string, string, byte[])
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. it takes precedence over filePath @throws IOException on error
public static PdfFileSpecification FileEmbedded(PdfWriter writer, string filePath, string fileDisplay, byte[] fileStore)
Parameters
writer
PdfWriterthe PdfWriter
filePath
stringthe file path
fileDisplay
stringthe file information that is presented to the user
fileStore
byte[]the byte array with the file. If it is not null
Returns
- PdfFileSpecification
the file specification
FileEmbedded(PdfWriter, string, string, byte[], bool)
Creates a file specification with the file embedded. The file may come from the file system or from a byte array. it takes precedence over filePath from compression @throws IOException on error
public static PdfFileSpecification FileEmbedded(PdfWriter writer, string filePath, string fileDisplay, byte[] fileStore, bool compress)
Parameters
writer
PdfWriterthe PdfWriter
filePath
stringthe file path
fileDisplay
stringthe file information that is presented to the user
fileStore
byte[]the byte array with the file. If it is not null
compress
boolsets the compression on the data. Multimedia content will benefit little
Returns
- PdfFileSpecification
the file specification
FileEmbedded(PdfWriter, string, string, byte[], bool, string, PdfDictionary)
Creates a file specification with the file embedded. The file may come from the file system or from a byte array. it takes precedence over filePath from compression @throws IOException on error
public static PdfFileSpecification FileEmbedded(PdfWriter writer, string filePath, string fileDisplay, byte[] fileStore, bool compress, string mimeType, PdfDictionary fileParameter)
Parameters
writer
PdfWriterthe PdfWriter
filePath
stringthe file path
fileDisplay
stringthe file information that is presented to the user
fileStore
byte[]the byte array with the file. If it is not null
compress
boolsets the compression on the data. Multimedia content will benefit little
mimeType
stringthe optional mimeType
fileParameter
PdfDictionarythe optional extra file parameters such as the creation or modification date
Returns
- PdfFileSpecification
the file specification
FileEmbedded(PdfWriter, string, string, byte[], int)
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. it takes precedence over filePath it takes precedence over filePath @throws IOException on error @since 2.1.3
public static PdfFileSpecification FileEmbedded(PdfWriter writer, string filePath, string fileDisplay, byte[] fileStore, int compressionLevel)
Parameters
writer
PdfWriterthe PdfWriter
filePath
stringthe file path
fileDisplay
stringthe file information that is presented to the user
fileStore
byte[]the byte array with the file. If it is not null
compressionLevel
intthe compression level to be used for compressing the file
Returns
- PdfFileSpecification
the file specification
FileEmbedded(PdfWriter, string, string, byte[], string, PdfDictionary, int)
Creates a file specification with the file embedded. The file may come from the file system or from a byte array. it takes precedence over filePath @throws IOException on error @since 2.1.3
public static PdfFileSpecification FileEmbedded(PdfWriter writer, string filePath, string fileDisplay, byte[] fileStore, string mimeType, PdfDictionary fileParameter, int compressionLevel)
Parameters
writer
PdfWriterthe PdfWriter
filePath
stringthe file path
fileDisplay
stringthe file information that is presented to the user
fileStore
byte[]the byte array with the file. If it is not null
mimeType
stringthe optional mimeType
fileParameter
PdfDictionarythe optional extra file parameters such as the creation or modification date
compressionLevel
intthe level of compression
Returns
- PdfFileSpecification
the file specification
FileExtern(PdfWriter, string)
Creates a file specification for an external file.
public static PdfFileSpecification FileExtern(PdfWriter writer, string filePath)
Parameters
Returns
- PdfFileSpecification
the file specification
SetUnicodeFileName(string, bool)
Adds the unicode file name (the key /UF). This entry was introduced in PDF 1.7. The filename must have the slash and backslash escaped according to the file specification rules.
public void SetUnicodeFileName(string filename, bool unicode)
Parameters
filename
stringthe filename
unicode
boolif true, the filename is UTF-16BE encoded; otherwise PDFDocEncoding is used;
Url(PdfWriter, string)
Creates a file specification of type URL.
public static PdfFileSpecification Url(PdfWriter writer, string url)
Parameters
Returns
- PdfFileSpecification
the file specification