[]
Represents a PDF File Specification.
The complex architecture of this class is based on the PDF Specification, for full details please consult that spec.
In many practical scenarios while generating PDFs, using the provided static constructors on the derived classes (FileSpecification, EmbeddedFileStream etc.) may be enough though.
public class FileSpecification : PdfDynamicWrapper<IPdfObject>
Initializes a new instance of the FileSpecification class.
public FileSpecification()
Gets or sets the description of this File Specification.
public string Desc { get; set; }
Gets the FileSpecification.FileInfo object defining information about referenced file for DOS platform. NOTE: Using this property is not recommended beginning with PDF 1.7.
public FileSpecification.FileInfo DOSFile { get; }
Gets the FileSpecification.FileInfo object that specifies information about a referenced file. Note that this property should be used for files with names containing ASCII characters only, and is provided for backwards compatibility. For file names that contain non-ASCII characters, UnicodeFile should be used instead.
public FileSpecification.FileInfo File { get; }
Gets or sets the file system to be used to interpret this file specification.
public string FileSystem { get; set; }
If this property is present, all other properties are interpreted by the designated file system. PDF defines only one standard file system name, URL; an application or plug-in extension can register other names.
Gets a value indicating that this file specification has at least one EmbeddedFileStream associated with it.
public bool HasEmbeddedFileStream { get; }
Gets or sets the FileID object specifying the ID of the referenced file.
public FileID ID { get; set; }
This property improves an application’s chances of finding the intended file and allows it to warn the user if the file has changed since the link was made.
Gets the FileSpecification.FileInfo object defining information about referenced file for Mac OS platform. NOTE: Using this property is not recommended beginning with PDF 1.7.
public FileSpecification.FileInfo MacFile { get; }
Gets or sets a value that represents the relationship of this object to the source that points to it.
Predefined values are Source, Data, Alternative, Supplement and Unspecified.
public string Relationship { get; set; }
Gets the FileSpecification.FileInfo object that specifies information about a referenced file.
public FileSpecification.FileInfo UnicodeFile { get; }
Gets the FileSpecification.FileInfo object defining information about referenced file for Unix platform. NOTE: Using this property is not recommended beginning with PDF 1.7.
public FileSpecification.FileInfo UnixFile { get; }
Gets or sets a value indicating whether the file referenced by the file specification is volatile (changes frequently with time). If the value is true, applications should never cache a copy of the file.
public bool Volatile { get; set; }
Creates a FileSpecification object from a DOS file name.
public static FileSpecification FromDOSFileName(string fileName)
fileName
stringCreates a FileSpecification object referencing a specified EmbeddedFileStream.
public static FileSpecification FromEmbeddedFile(EmbeddedFileStream embeddedFileStream, string description = null)
embeddedFileStream
EmbeddedFileStreamdescription
stringCreates a FileSpecification object referencing a specified EmbeddedFileStream.
public static FileSpecification FromEmbeddedStream(string fileName, EmbeddedFileStream embeddedFileStream, string description = null)
fileName
stringembeddedFileStream
EmbeddedFileStreamdescription
stringCreates a FileSpecification object representing an URI reference.
public static FileSpecification FromURI(string uri)
uri
stringGets a System.IO.Stream containing the content of this FileSpecification, or null if the file specification is empty.
Important: this System.IO.Stream must be disposed after use.
public Stream GetStream()
A System.IO.Stream with the content of this FileSpecification, or null if it is empty. If not null, the stream must be disposed after use!