Click or drag to resize

Document Methods

The Document type exposes the following members.

Methods
  NameDescription
Public methodAddBookmark(String, ExplicitDestination)
Creates a root bookmark for the document
Public methodAddBookmark(String, ExplicitDestination, Bookmark)
Creates a child bookmark for the existing parentBookmark
Public methodAddFont(Font)
Adds a system font to the fonts collection. If the font was already added the method returns the existing font. By default the font is embedded in the PDF document in order to support Unicode texts.
Public methodAddFont(String)
Adds a system font to the fonts collection. The font is created from the specified file. If the font was already added the method returns the existing font.
Public methodAddFont(StandardCJKFont)
Adds a standard CJK font to the collection. If the font was already added the method returns the existing font.
Public methodAddFont(StdFontBaseFamily)
Adds a standard font to the collection. If the font was already added the method returns the existing font.
Public methodAddFont(Font, Boolean)
Adds a system font to the fonts collection. If the font was already added the method returns the existing font. The embedFont property indicates if the added font will be embedded into the PDF document.
Public methodAddPage
Creates a new PDF page and adds it to the collection. If there is a previous page in the collection, the orientation and size are inherited from the that page otherwise a first page with the default A4 size and Portrait orientation is created. The page margins are inherited from the default document margins
Public methodAddPage(Margins)
Creates a new PDF page and adds it to the collection. If there is a previous page in the collection, the orientation and size are inherited from the that page otherwise a first page with the default A4 size and Portrait orientation is created
Public methodAddPage(PdfPage)
Adds the specified page to the document pages collection. The page to be added is allowed to be from another document. The source document of the page to be added must remain opened until the current document is saved.
Public methodAddPage(PageSize, Margins)
Creates a new PDF page and adds it to the collection. If there is a previous page in the collection, the page orientation is inherited from the that page otherwise a first page with the specified size and Portrait orientation is created
Public methodAddPage(PageSize, Margins, PDFPageOrientation)
Creates a new PDF page with the specified size, margins and orientation and adds it to the collection
Public methodAddTemplate(RectangleF)
Add a new template with the specified bounds to the document templates collection.
Public methodAddTemplate(Single, Single)
Add a new template with the specified width and height to the document templates collection. The template location is top left corner of the page.
Public methodAppendDocument
Appends all pages from the another document specified as parameter to the current document. A custom range of pages from another document can be appended to the current document calling the Document.Pages.Add(PdfPage pdfPage) method for each page to be appended. The appended document must remain open until the current document is saved.
Public methodClose
Releases all the resources allocated by this PDF document. Always call this method after the document was saved. If the document was created from a stream or file, the stream will be closed if it was not explicitly detached by calling the DetachStream() before the document is closed.
Public methodDetachStream
Call this method to detach the stream from which this document was created. When this method is called before calling Close(), the Close method will not close the detached stream.
Public methodStatic memberGetPageCount(Stream)
A fast method to obtain the page count of a specified PDF document.
Public methodStatic memberGetPageCount(String)
A fast method to obtain the page count of a specified PDF document.
Public methodInsertPage(Int32, PdfPage)
Inserts the specified page into the document pages collection at the specified index. The page to be added is allowed to be from another document. The source document of the page to be inserted must remain opened until the current document is saved.
Public methodInsertPage(Int32, PageSize, Margins, PDFPageOrientation)
Creates a new PDF page with the specified size, margins and orientation and inserts it into the collection at the specified index.
Public methodRemovePage(Int32)
Removes the PDF page at the specified index in pages collection.
Public methodRemovePage(PdfPage)
Removes the specified PDF page from the pages collection.
Public methodSave
Saves the PDF document as byte array that can be further saved into a file or send over HTTP.
Public methodSave(Stream)
Saves the document into the specified stream.
Public methodSave(String)
Saves the PDF document into the specified file.
Top
See Also