[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.FileSpecification

Class FileSpecification

Namespace
GrapeCity.Documents.Pdf
Assembly
GcDocs.Pdf.dll

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>
Inheritance
object
GrapeCity.Documents.Pdf.Wrappers.PdfDynamicWrapper<T><GrapeCity.Documents.Pdf.Spec.IPdfObject>
FileSpecification
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

FileSpecification()

Initializes a new instance of the FileSpecification class.

public FileSpecification()

Properties

Desc

Gets or sets the description of this File Specification.

public string Desc { get; set; }

Property Value

string

DOSFile

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; }

Property Value

FileSpecification.FileInfo

File

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; }

Property Value

FileSpecification.FileInfo
See Also

FileSystem

Gets or sets the file system to be used to interpret this file specification.

public string FileSystem { get; set; }

Property Value

string

Remarks

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.

HasEmbeddedFileStream

Gets a value indicating that this file specification has at least one EmbeddedFileStream associated with it.

public bool HasEmbeddedFileStream { get; }

Property Value

bool

ID

Gets or sets the FileID object specifying the ID of the referenced file.

public FileID ID { get; set; }

Property Value

FileID

Remarks

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.

MacFile

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; }

Property Value

FileSpecification.FileInfo

Relationship

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; }

Property Value

string

UnicodeFile

Gets the FileSpecification.FileInfo object that specifies information about a referenced file.

public FileSpecification.FileInfo UnicodeFile { get; }

Property Value

FileSpecification.FileInfo
See Also

UnixFile

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; }

Property Value

FileSpecification.FileInfo

Volatile

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; }

Property Value

bool

Methods

FromDOSFileName(string)

Creates a FileSpecification object from a DOS file name.

public static FileSpecification FromDOSFileName(string fileName)

Parameters

fileName string

Returns

FileSpecification

FromEmbeddedFile(EmbeddedFileStream, string)

Creates a FileSpecification object referencing a specified EmbeddedFileStream.

public static FileSpecification FromEmbeddedFile(EmbeddedFileStream embeddedFileStream, string description = null)

Parameters

embeddedFileStream EmbeddedFileStream
description string

Returns

FileSpecification

FromEmbeddedStream(string, EmbeddedFileStream, string)

Creates a FileSpecification object referencing a specified EmbeddedFileStream.

public static FileSpecification FromEmbeddedStream(string fileName, EmbeddedFileStream embeddedFileStream, string description = null)

Parameters

fileName string
embeddedFileStream EmbeddedFileStream
description string

Returns

FileSpecification

FromURI(string)

Creates a FileSpecification object representing an URI reference.

public static FileSpecification FromURI(string uri)

Parameters

uri string

Returns

FileSpecification

GetStream()

Gets 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()

Returns

System.IO.Stream

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!