PdfSharp-WPF  1.31.7289
PdfSharp.Pdf.PdfDocument Class Reference

Represents a PDF document. More...

Inheritance diagram for PdfSharp.Pdf.PdfDocument:
PdfSharp.Pdf.PdfObject PdfSharp.Pdf.PdfItem

Classes

class  DocumentHandle
 

Public Member Functions

 PdfDocument ()
 Creates a new PDF document in memory. To open an existing PDF file, use the PdfReader class. More...
 
 PdfDocument (string filename)
 Creates a new PDF document with the specified file name. The file is immediately created and keeps looked until the document is saved. To open an existing PDF file and import it, use the PdfReader class. More...
 
 PdfDocument (Stream outputStream)
 Creates a new PDF document using the specified stream. To open an existing PDF file, use the PdfReader class. More...
 
void Dispose ()
 Disposes all references to this document stored in other documents. This function should be called for documents you finished importing pages from. Calling Dispose is technically not necessary but useful for earlier reclaiming memory of documents you do not need anymore. More...
 
void Close ()
 Closes this instance. More...
 
void Save (string path)
 Saves the document to the specified path. If a file already exists, it will be overwritten. More...
 
void Save (Stream stream, bool closeStream)
 Saves the document to the specified stream. More...
 
void Save (Stream stream)
 Saves the document to the specified stream and closes the stream. More...
 
bool CanSave (ref string message)
 Determines whether the document can be saved. More...
 
PdfPage AddPage ()
 Creates a new page and adds it to this document. More...
 
PdfPage AddPage (PdfPage page)
 Adds the specified page to this document. If the page is from an external document, it is imported to this document. In this case the returned page is not the same object as the specified one. More...
 
PdfPage InsertPage (int index)
 Creates a new page and inserts it in this document at the specified position. More...
 
PdfPage InsertPage (int index, PdfPage page)
 Inserts the specified page in this document. If the page is from an external document, it is imported to this document. In this case the returned page is not the same object as the specified one. More...
 
- Public Member Functions inherited from PdfSharp.Pdf.PdfObject
new PdfObject Clone ()
 Creates a copy of this object. The clone does not belong to a document, i.e. its owner and its iref are null. More...
 
- Public Member Functions inherited from PdfSharp.Pdf.PdfItem
PdfItem Clone ()
 Creates a copy of this object. More...
 

Properties

object Tag [get, set]
 Gets or sets a user defined object that contains arbitrary information associated with this document. The tag is not used by PDFsharp. More...
 
PdfDocumentOptions Options [get]
 Gets the document options used for saving the document. More...
 
PdfDocumentSettings Settings [get]
 Gets PDF specific document settings. More...
 
int Version [get, set]
 Gets or sets the PDF version number. Return value 14 e.g. means PDF 1.4 / Acrobat 5 etc. More...
 
int PageCount [get]
 Gets the number of pages in the document. More...
 
long FileSize [get]
 Gets the file size of the document. More...
 
string FullPath [get]
 Gets the full qualified file name if the document was read form a file, or an empty string otherwise. More...
 
Guid Guid [get]
 Gets a Guid that uniquely identifies this instance of PdfDocument. More...
 
bool IsImported [get]
 Returns a value indicating whether the document was newly created or opened from an existing document. Returns true if the document was opened with the PdfReader.Open function, false otherwise. More...
 
bool IsReadOnly [get]
 Returns a value indicating whether the document is read only or can be modified. More...
 
PdfDocumentInformation Info [get]
 Gets information about the document. More...
 
PdfCustomValues CustomValues [get, set]
 This function is intended to be undocumented. More...
 
PdfPages Pages [get]
 Get the pages dictionary. More...
 
PdfPageLayout PageLayout [get, set]
 Gets or sets a value specifying the page layout to be used when the document is opened. More...
 
PdfPageMode PageMode [get, set]
 Gets or sets a value specifying how the document should be displayed when opened. More...
 
PdfViewerPreferences ViewerPreferences [get]
 Gets the viewer preferences of this document. More...
 
PdfOutline.PdfOutlineCollection Outlines [get]
 Gets the root of the outline (or bookmark) tree. More...
 
PdfAcroForm AcroForm [get]
 Get the AcroForm dictionary. More...
 
string Language [get, set]
 Gets or sets the default language of the document. More...
 
PdfSecuritySettings SecuritySettings [get]
 Gets the security settings of this document. More...
 
new PdfInternals Internals [get]
 Gets the PdfInternals object of this document, that grants access to some internal structures which are not part of the public interface of PdfDocument. More...
 
PdfStandardSecurityHandler SecurityHandler [get]
 Gets the security handler. More...
 
- Properties inherited from PdfSharp.Pdf.PdfObject
virtual PdfDocument Owner [get]
 Gets the PdfDocument this object belongs to. More...
 
bool IsIndirect [get]
 Indicates whether the object is an indirect object. More...
 
PdfObjectInternals Internals [get]
 Gets the PdfInternals object of this document, that grants access to some internal structures which are not part of the public interface of PdfDocument. More...
 
PdfReference Reference [get, set]
 Gets the indirect reference of this object. If the value is null, this object is a direct object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from PdfSharp.Pdf.PdfObject
 PdfObject ()
 Initializes a new instance of the PdfObject class. More...
 
 PdfObject (PdfDocument document)
 Initializes a new instance of the PdfObject class. More...
 
 PdfObject (PdfObject obj)
 Initializes a new instance from an existing object. Used for object type transformation. More...
 
override object Copy ()
 Implements the copy mechanism. Must be overridden in derived classes. More...
 

Detailed Description

Represents a PDF document.

Constructor & Destructor Documentation

◆ PdfDocument() [1/3]

PdfSharp.Pdf.PdfDocument.PdfDocument ( )

Creates a new PDF document in memory. To open an existing PDF file, use the PdfReader class.

◆ PdfDocument() [2/3]

PdfSharp.Pdf.PdfDocument.PdfDocument ( string  filename)

Creates a new PDF document with the specified file name. The file is immediately created and keeps looked until the document is saved. To open an existing PDF file and import it, use the PdfReader class.

◆ PdfDocument() [3/3]

PdfSharp.Pdf.PdfDocument.PdfDocument ( Stream  outputStream)

Creates a new PDF document using the specified stream. To open an existing PDF file, use the PdfReader class.

Member Function Documentation

◆ AddPage() [1/2]

PdfPage PdfSharp.Pdf.PdfDocument.AddPage ( )

Creates a new page and adds it to this document.

◆ AddPage() [2/2]

PdfPage PdfSharp.Pdf.PdfDocument.AddPage ( PdfPage  page)

Adds the specified page to this document. If the page is from an external document, it is imported to this document. In this case the returned page is not the same object as the specified one.

◆ CanSave()

bool PdfSharp.Pdf.PdfDocument.CanSave ( ref string  message)

Determines whether the document can be saved.

◆ Close()

void PdfSharp.Pdf.PdfDocument.Close ( )

Closes this instance.

◆ Dispose()

void PdfSharp.Pdf.PdfDocument.Dispose ( )

Disposes all references to this document stored in other documents. This function should be called for documents you finished importing pages from. Calling Dispose is technically not necessary but useful for earlier reclaiming memory of documents you do not need anymore.

◆ InsertPage() [1/2]

PdfPage PdfSharp.Pdf.PdfDocument.InsertPage ( int  index)

Creates a new page and inserts it in this document at the specified position.

◆ InsertPage() [2/2]

PdfPage PdfSharp.Pdf.PdfDocument.InsertPage ( int  index,
PdfPage  page 
)

Inserts the specified page in this document. If the page is from an external document, it is imported to this document. In this case the returned page is not the same object as the specified one.

◆ Save() [1/3]

void PdfSharp.Pdf.PdfDocument.Save ( Stream  stream)

Saves the document to the specified stream and closes the stream.

◆ Save() [2/3]

void PdfSharp.Pdf.PdfDocument.Save ( Stream  stream,
bool  closeStream 
)

Saves the document to the specified stream.

◆ Save() [3/3]

void PdfSharp.Pdf.PdfDocument.Save ( string  path)

Saves the document to the specified path. If a file already exists, it will be overwritten.

Property Documentation

◆ AcroForm

PdfAcroForm PdfSharp.Pdf.PdfDocument.AcroForm
get

Get the AcroForm dictionary.

◆ CustomValues

PdfCustomValues PdfSharp.Pdf.PdfDocument.CustomValues
getset

This function is intended to be undocumented.

◆ FileSize

long PdfSharp.Pdf.PdfDocument.FileSize
get

Gets the file size of the document.

◆ FullPath

string PdfSharp.Pdf.PdfDocument.FullPath
get

Gets the full qualified file name if the document was read form a file, or an empty string otherwise.

◆ Guid

Guid PdfSharp.Pdf.PdfDocument.Guid
get

Gets a Guid that uniquely identifies this instance of PdfDocument.

◆ Info

PdfDocumentInformation PdfSharp.Pdf.PdfDocument.Info
get

Gets information about the document.

◆ Internals

new PdfInternals PdfSharp.Pdf.PdfDocument.Internals
get

Gets the PdfInternals object of this document, that grants access to some internal structures which are not part of the public interface of PdfDocument.

◆ IsImported

bool PdfSharp.Pdf.PdfDocument.IsImported
get

Returns a value indicating whether the document was newly created or opened from an existing document. Returns true if the document was opened with the PdfReader.Open function, false otherwise.

◆ IsReadOnly

bool PdfSharp.Pdf.PdfDocument.IsReadOnly
get

Returns a value indicating whether the document is read only or can be modified.

◆ Language

string PdfSharp.Pdf.PdfDocument.Language
getset

Gets or sets the default language of the document.

◆ Options

PdfDocumentOptions PdfSharp.Pdf.PdfDocument.Options
get

Gets the document options used for saving the document.

◆ Outlines

PdfOutline.PdfOutlineCollection PdfSharp.Pdf.PdfDocument.Outlines
get

Gets the root of the outline (or bookmark) tree.

◆ PageCount

int PdfSharp.Pdf.PdfDocument.PageCount
get

Gets the number of pages in the document.

◆ PageLayout

PdfPageLayout PdfSharp.Pdf.PdfDocument.PageLayout
getset

Gets or sets a value specifying the page layout to be used when the document is opened.

◆ PageMode

PdfPageMode PdfSharp.Pdf.PdfDocument.PageMode
getset

Gets or sets a value specifying how the document should be displayed when opened.

◆ Pages

PdfPages PdfSharp.Pdf.PdfDocument.Pages
get

Get the pages dictionary.

◆ SecurityHandler

PdfStandardSecurityHandler PdfSharp.Pdf.PdfDocument.SecurityHandler
get

Gets the security handler.

◆ SecuritySettings

PdfSecuritySettings PdfSharp.Pdf.PdfDocument.SecuritySettings
get

Gets the security settings of this document.

◆ Settings

PdfDocumentSettings PdfSharp.Pdf.PdfDocument.Settings
get

Gets PDF specific document settings.

◆ Tag

object PdfSharp.Pdf.PdfDocument.Tag
getset

Gets or sets a user defined object that contains arbitrary information associated with this document. The tag is not used by PDFsharp.

◆ Version

int PdfSharp.Pdf.PdfDocument.Version
getset

Gets or sets the PDF version number. Return value 14 e.g. means PDF 1.4 / Acrobat 5 etc.

◆ ViewerPreferences

PdfViewerPreferences PdfSharp.Pdf.PdfDocument.ViewerPreferences
get

Gets the viewer preferences of this document.


The documentation for this class was generated from the following file: