[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.GcPdfDocument

Class GcPdfDocument

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

Represents a PDF document.

The object model provided by this class follows the PDF 1.7 Reference specification.

public class GcPdfDocument
Inheritance
object
GcPdfDocument
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Constructors

GcPdfDocument(string)

Creates a new instance of the GcPdfDocument class, optionally specifying a license key.

public GcPdfDocument(string licenseKey = null)

Parameters

licenseKey string

The license key to use. If null, and SetLicenseKey(string) has been called, the key set with that method is used.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Properties

AcroForm

Gets the AcroForm object defining common properties of the AcroForms in this document.

public AcroForm AcroForm { get; }

Property Value

AcroForm

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ArticleThreads

Gets the list of ArticleThread objects.

public IList<ArticleThread> ArticleThreads { get; }

Property Value

System.Collections.Generic.IList<T><ArticleThread>

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

AssociatedFiles

Gets the collection of embedded files associated with whole document. Typically it is used to identify which embedded file was the source of the PDF document.

public AssociatedFiles AssociatedFiles { get; }

Property Value

AssociatedFiles

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

BuildRichTextAppearanceStreams

Gets or sets a value indicating whether to generate appearance streams for annotations that have rich text content (FreeTextAnnotation, LineAnnotation). The default value for this property is false.

Note that currently there is a limitation: if this property is set to true so that appearance streams for rich text are generated, all rich text formatting is ignored.

public static bool BuildRichTextAppearanceStreams { get; set; }

Property Value

bool

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

CMapProvider

Gets or sets an object that implements the ICMapProvider interface. GcPdfDocument uses that interface to obtain an GrapeCity.Documents.Pdf.Text.CMap.CMap if it specified by name in the PDF file.

By default GcPdf tries to initialize this property automatically in the GcPdfDocument's constructor with the CMapProvider.Instance defined in the optional GrapeCity.Documents.Pdf.Resources package (which in this case needs to be explicitly referenced by the application).

public static ICMapProvider CMapProvider { get; set; }

Property Value

ICMapProvider

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

CompressionLevel

Gets or sets the compression level. Default value is System.IO.Compression.CompressionLevel.Fastest.

public CompressionLevel CompressionLevel { get; set; }

Property Value

System.IO.Compression.CompressionLevel

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ConformanceLevel

Gets or sets the PDF/A conformance level.

The default is none (the document does not conform to PDF/A).

public PdfAConformanceLevel ConformanceLevel { get; set; }

Property Value

PdfAConformanceLevel

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

DestinationsDests

Gets the dictionary of named destinations defined in the Dests entry of the document catalog.

public IDictionary<PdfName, IDestination> DestinationsDests { get; }

Property Value

System.Collections.Generic.IDictionary<TKey, TValue><PdfName, IDestination>

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

DestinationsNamesDests

Gets the dictionary of named destinations defined in the Dests entry of the Name Dictionary.

public IDictionary<PdfString, IDestination> DestinationsNamesDests { get; }

Property Value

System.Collections.Generic.IDictionary<TKey, TValue><PdfString, IDestination>

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

DocumentInfo

Gets or sets a DocumentInfo object that contains information about this document (author, title, etc).

Note: this property is not null by default (when a GcPdfDocument is created) but it can become null after a call to Load(Stream, string) if the loaded document does not have a document info object.

public DocumentInfo DocumentInfo { get; set; }

Property Value

DocumentInfo

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

EmbeddedFiles

Gets the dictionary of document level file attachments.

public IDictionary<string, FileSpecification> EmbeddedFiles { get; }

Property Value

System.Collections.Generic.IDictionary<TKey, TValue><string, FileSpecification>

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

FileID

Gets or sets the FileID object defining ID of this PDF document. Note that this ID is automatically updated if the Clear() method is called.

public FileID FileID { get; set; }

Property Value

FileID

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

FontCollection

Gets or sets the IFontCollection object used when the GcPdfDocument needs to find a Font (e.g. if it is not embedded in the PDF). If this property is null (the default), then the SystemFonts will be used.

public IFontCollection FontCollection { get; set; }

Property Value

IFontCollection

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

FontEmbedMode

Gets or sets the font embedding mode.

The default is EmbedSubset.

Note that this property does not affect the 14 standard PDF fonts, their embedding is determined by the StandardFontEmbedMode property.

Also note that if the GcPdfDocument is saved as PDF/A, and the value of this property is NotEmbed, the fonts are embedded anyway using the EmbedSubset mode.

public FontEmbedMode FontEmbedMode { get; set; }

Property Value

FontEmbedMode

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

FontHandlers

Gets the collection of font handlers associated with the current document.

public FontHandlerCollection FontHandlers { get; }

Property Value

FontHandlerCollection

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

FormEmbedUtf32CodeSet

Gets or sets a Utf32CodeSet object that specifies which Unicode characters to include in embedded font subsets for fonts that are used in AcroForms.

This value will be used for a font if that font handler's Utf32CodeSet is null.

Note that if for a font, its Utf32CodeSet is null, and FormEmbedUtf32CodeSet is null, and the font is used in the AcroForm, then this whole font will be embedded even if partial embedding is specified by EmbedMode or FontEmbedMode.

public Utf32CodeSet FormEmbedUtf32CodeSet { get; set; }

Property Value

Utf32CodeSet

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ImageHandlers

Gets the collection of PdfImageHandler objects associated with the current document.

public PdfImageHandlerCollection ImageHandlers { get; }

Property Value

PdfImageHandlerCollection

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ImageOptions

Gets the ImageOptions object that contains options controlling how images are processed in the current document.

public ImageOptions ImageOptions { get; }

Property Value

ImageOptions

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

IsCompressed

Gets a value indicating whether compression is used when saving the document.

public bool IsCompressed { get; }

Property Value

bool

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

See Also

Landscape

Gets or sets a value indicating whether newly added pages have landscape orientation.

public bool Landscape { get; set; }

Property Value

bool

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Lang

Gets or sets a language identifier specifying the natural language for all text in the document except where overridden by language specifications for structure elements or marked content. If this entry is absent, the language is considered unknown.

public string Lang { get; set; }

Property Value

string

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Linearized

Gets a value indicating whether the PDF that was loaded into this GcPdfDocument was linearized ("fast web view").

Note that this value only indicates the linearization of the original PDF that was loaded, if the current document is saved its linearization is not affected by this property. To save the current document as linearized, pass Linearized when saving the PDF using one of the save methods:

public bool Linearized { get; }

Property Value

bool

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

LoadStream

Gets the System.IO.Stream object that was passed to the Load() method that was used to load this document, or null if Load() was not called.

public Stream LoadStream { get; }

Property Value

System.IO.Stream

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

See Also

MarkInfo

Gets a MarkInfo object that provides additional information relevant to specialized uses of structured PDF documents.

public MarkInfo MarkInfo { get; }

Property Value

MarkInfo

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Metadata

Gets or sets the metadata associated with this document.

public Metadata Metadata { get; set; }

Property Value

Metadata

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

NamedDestinations

Gets the dictionary of named destinations defined in the current document.

public IDictionary<string, IDestination> NamedDestinations { get; }

Property Value

System.Collections.Generic.IDictionary<TKey, TValue><string, IDestination>

Remarks

According to the PDF specification, the named destinations can be specified in two ways:

  • As a PDF Dictionary in the Dests entry of the document catalog.
  • As a PDF Name Tree in the Dests entry of the document Name Dictionary.
This property combines the destinations from both sources into a single dictionary.

OpenAction

Gets or sets a DestinationBase to be displayed or an ActionBase to be performed when the document is opened.

public DocAction OpenAction { get; set; }

Property Value

DocAction

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

OptionalContent

Gets the OptionalContentProperties object that contains information about optional PDF content (layers) in this document.

public OptionalContentProperties OptionalContent { get; }

Property Value

OptionalContentProperties

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Outlines

Gets the collection of the current document outlines.

public OutlineNodeCollection Outlines { get; }

Property Value

OutlineNodeCollection

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

OutputIntents

Gets the list of OutputIntent objects associated with the current document.

Note that if the document is saved as PDF/A (see PdfAConformanceLevel) and this collection is empty, a default output intent will be automatically added to it.

public IList<OutputIntent> OutputIntents { get; }

Property Value

System.Collections.Generic.IList<T><OutputIntent>

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

PageLabelingRanges

Gets the dictionary of PageLabelingRange objects. Each key in this dictionary is the index of the first page in a labeling range.

public IDictionary<int, PageLabelingRange> PageLabelingRanges { get; }

Property Value

System.Collections.Generic.IDictionary<TKey, TValue><int, PageLabelingRange>

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

PageLayout

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

public PageLayout? PageLayout { get; set; }

Property Value

PageLayout?

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

PageMode

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

public PageMode PageMode { get; set; }

Property Value

PageMode

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

PageRectangle

Gets a rectangle that represents the surface of the current page (in points).

public RectangleF PageRectangle { get; }

Property Value

System.Drawing.RectangleF

Remarks

This property returns a rectangle located at point (0,0) with size equal to the size of the current page. It can be used as a starting point for building rectangles that will be used for drawing on the page.

Pages

Gets the collection of Page objects that make up the document.

public PageCollection Pages { get; }

Property Value

PageCollection

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

PageSize

Gets or sets the default page size for the document (in points).

public SizeF PageSize { get; set; }

Property Value

System.Drawing.SizeF

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

PaperKind

Gets or sets the page size for the document.

public PaperKind PaperKind { get; set; }

Property Value

PaperKind

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

PdfACompliant

Gets or sets a value indicating whether the document is PDF/A compliant.

[Obsolete("Use ConformanceLevel")]
public bool PdfACompliant { get; set; }

Property Value

bool

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

PdfVersion

Gets or sets the PDF Version of the generated document.

By default the version is determined automatically based on which features are used in this document. Setting this property to a non-null string in the format "1.X" (where X is a digit from 0 to 9) overrides the automatic value with the specified one.

Setting this property to null or an empty string reverts to the default behavior.

public string PdfVersion { get; set; }

Property Value

string

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

RecognitionAlgorithm

Gets or sets the type of algorithm that is used for PDF content recognition when building page text maps (see GetTextMap(float, float, bool)).

This property affects the behavior of methods such as GetText(bool), FindText(FindTextParams, OutputRange), FindText(FindTextParams, FindTextCallback) and other APIs that rely on text maps.

public RecognitionAlgorithm RecognitionAlgorithm { get; set; }

Property Value

RecognitionAlgorithm

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Security

Gets the GrapeCity.Documents.Pdf.Security object that manages security for the current document (passwords, etc).

public Security Security { get; }

Property Value

Security

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SecurityStore

Gets the DocumentSecurityStore object associated with this document.

public DocumentSecurityStore SecurityStore { get; }

Property Value

DocumentSecurityStore

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

StandardFontEmbedMode

Gets or sets the font embedding mode for the 14 standard PDF fonts.

The default is NotEmbed.

Note that if the GcPdfDocument is saved as PDF/A, and the value of this property is NotEmbed, the standard fonts are embedded anyway using the EmbedSubset mode.

public FontEmbedMode StandardFontEmbedMode { get; set; }

Property Value

FontEmbedMode

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

StructTreeRoot

Gets a StructTreeRoot object that represents the current document's structure tree as defined by PDF structure tags.

public StructTreeRoot StructTreeRoot { get; }

Property Value

StructTreeRoot

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ViewerPreferences

Gets the ViewerPreferences object that contains information specifying how the current document should be displayed.

public ViewerPreferences ViewerPreferences { get; }

Property Value

ViewerPreferences

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

WriteComments

Gets or sets a value indicating whether comments and some optional line breaks will be added to the generated PDF file. Primarily useful for debugging.

public bool WriteComments { get; set; }

Property Value

bool

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Methods

Clear()

Clears the document, removing all content and resetting all properties and settings to their initial default values.

public void Clear()

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

DeleteText(FindTextParams, DeleteTextMode, OutputRange)

Deletes a specified text from all pages of the current document.

Note that the results may be affected by the current value of the RecognitionAlgorithm property.

public void DeleteText(FindTextParams findTextParams, DeleteTextMode mode, OutputRange searchRange = null)

Parameters

findTextParams FindTextParams

The text to search for.

mode DeleteTextMode

The text delete mode.

searchRange OutputRange

The search scope.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

EndDoc()

Ends document generation in sequential mode. This call must be preceded by a call to StartDoc(Stream).

public void EndDoc()

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

See Also

ExportFormDataToFDF(Stream, ExportFormDataOptions)

Exports the document's form data to a stream in FDF format.

public void ExportFormDataToFDF(Stream stream, ExportFormDataOptions options = null)

Parameters

stream System.IO.Stream

The destination stream.

options ExportFormDataOptions

The ExportFormDataOptions object defining the export options.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ExportFormDataToFDF(string, ExportFormDataOptions)

Exports the document's form data to a file in FDF format.

public void ExportFormDataToFDF(string fileName, ExportFormDataOptions options = null)

Parameters

fileName string

The destination file.

options ExportFormDataOptions

The ExportFormDataOptions object defining the export options.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ExportFormDataToXFDF(Stream, ExportFormDataOptions)

Exports the document's form data to a stream in XFDF format.

public void ExportFormDataToXFDF(Stream stream, ExportFormDataOptions options = null)

Parameters

stream System.IO.Stream

The destination stream.

options ExportFormDataOptions

The ExportFormDataOptions object defining the export options.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ExportFormDataToXFDF(string, ExportFormDataOptions)

Exports the document's form data to a file in XFDF format.

public void ExportFormDataToXFDF(string fileName, ExportFormDataOptions options = null)

Parameters

fileName string

The destination file.

options ExportFormDataOptions

The ExportFormDataOptions object defining the export options.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ExportFormDataToXML(Stream, ExportFormDataOptions)

Exports the document's form data to a stream in XML format.

public void ExportFormDataToXML(Stream stream, ExportFormDataOptions options = null)

Parameters

stream System.IO.Stream

The destination stream.

options ExportFormDataOptions

The ExportFormDataOptions object defining the export options.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ExportFormDataToXML(string, ExportFormDataOptions)

Exports the document's form data to a file in XML format.

public void ExportFormDataToXML(string fileName, ExportFormDataOptions options = null)

Parameters

fileName string

The destination file.

options ExportFormDataOptions

The ExportFormDataOptions object defining the export options.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

FindText(FindTextParams, OutputRange)

Searches for all occurrences of a text in a range of the document's pages.

Note that the results are affected by the value of RecognitionAlgorithm property.

public IList<FoundPosition> FindText(FindTextParams findTextParams, OutputRange searchRange = null)

Parameters

findTextParams FindTextParams

The text searching parameters.

searchRange OutputRange

The search scope.

Returns

System.Collections.Generic.IList<T><FoundPosition>

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

GetFonts()

Gets the list of fonts in this GcPdfDocument.

public ICollection<Font> GetFonts()

Returns

System.Collections.Generic.ICollection<T><Font>

The list of fonts present in this document.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

GetImages(float, float, bool, bool)

Gets the list of images in this GcPdfDocument.

Note that for large documents this method can take a while to complete, as it enumerates the content streams of all pages in the document.

public IList<PdfImageInfo> GetImages(float dpiX, float dpiY, bool ignoreErrors, bool includeUnreferencedImages)

Parameters

dpiX float

The horizontal resolution used to calculate the bounds of images on pages.

dpiY float

The vertical resolution used to calculate the bounds of images on pages.

ignoreErrors bool

Indicates whether to ignore errors in PDF during processing.

includeUnreferencedImages bool

Indicates whether to include images that are not referenced from content streams.

Returns

System.Collections.Generic.IList<T><PdfImageInfo>

The list of images present in this document.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

GetImages(float, float, bool)

Gets the list of images in this GcPdfDocument.

Note that for large documents this method can take a while to complete, as it enumerates the content streams of all pages in the document.

public IList<PdfImageInfo> GetImages(float dpiX, float dpiY, bool ignoreErrors)

Parameters

dpiX float

The horizontal resolution used to calculate the bounds of images on pages.

dpiY float

The vertical resolution used to calculate the bounds of images on pages.

ignoreErrors bool

Indicates whether to ignore errors in PDF during processing.

Returns

System.Collections.Generic.IList<T><PdfImageInfo>

The list of images present in this document.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

GetImages(float, float)

Gets the list of images in this GcPdfDocument.

Note that for large documents this method can take a while to complete, as it enumerates the content streams of all pages in the document.

public IList<PdfImageInfo> GetImages(float dpiX = 72, float dpiY = 72)

Parameters

dpiX float

The horizontal resolution used to calculate the bounds of images on pages.

dpiY float

The vertical resolution used to calculate the bounds of images on pages.

Returns

System.Collections.Generic.IList<T><PdfImageInfo>

The list of images present in this document.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

GetLogicalStructure(ViewState, float, float, bool)

Parses the PDF's structure tree (as returned by the StructTreeRoot property) and creates a LogicalStructure object that represents the logical structure of the document.

Returns null if the current document does not have a structure tree.

public LogicalStructure GetLogicalStructure(ViewState viewState, float dpiX = 72, float dpiY = 72, bool ignoreErrors = true)

Parameters

viewState ViewState

The ViewState used to determine what document content would be considered.

dpiX float

The horizontal resolution (DPI) to use for positions and sizes of PDF elements.

dpiY float

The vertical resolution (DPI) to use for positions and sizes of PDF elements.

ignoreErrors bool

Indicates whether to ignore errors during processing.

Returns

LogicalStructure

The LogicalStructure object or null.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

GetLogicalStructure(float, float, bool)

Parses the PDF's structure tree (as returned by the StructTreeRoot property) and creates a LogicalStructure object that represents the logical structure of the document.

Returns null if the current document does not have a structure tree.

public LogicalStructure GetLogicalStructure(float dpiX = 72, float dpiY = 72, bool ignoreErrors = true)

Parameters

dpiX float

The horizontal resolution (DPI) to use for positions and sizes of PDF elements.

dpiY float

The vertical resolution (DPI) to use for positions and sizes of PDF elements.

ignoreErrors bool

Indicates whether to ignore errors during processing.

Returns

LogicalStructure

The LogicalStructure object or null.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

GetText(ViewState, bool)

Extracts and returns all text from the current document.

public string GetText(ViewState viewState, bool ignoreErrors = true)

Parameters

viewState ViewState

The ViewState used to determine what document content would be considered.

ignoreErrors bool

Indicates whether to ignore errors in PDF during processing.

Returns

string

All text in the current document.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

GetText(bool)

Extracts and returns all text from the current document.

public string GetText(bool ignoreErrors = true)

Parameters

ignoreErrors bool

Indicates whether to ignore errors in PDF during processing.

Returns

string

All text in the current document.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ImportFormDataFromCollection(KeyValuePair<IList<string>, IList<string>>[])

Imports the document's form data from a key/value collection.

The keys are collections of strings representing fully qualified field names including all parents if they exist, from the top parent to the field itself, e.g. new string[] { "TopParent", "Parent", "MyField" }.

The values are collections of field values.

This method may be especially useful when importing form data submitted by a web page.

public void ImportFormDataFromCollection(KeyValuePair<IList<string>, IList<string>>[] fieldValues)

Parameters

fieldValues KeyValuePair<System.Collections.Generic.IList<T><string>, System.Collections.Generic.IList<T><string>>[]

The collection of field names and their values.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ImportFormDataFromCollection(KeyValuePair<string, IList<string>>[])

Imports the document's form data from a key/value collection.

The keys are field names, the values are collections of field values.

For nested fields, the field's name should include all its parents' names delimited by dots, e.g. TopParent.Parent.MyField.

This method may be especially useful when importing form data submitted by a web page.

public void ImportFormDataFromCollection(KeyValuePair<string, IList<string>>[] fieldValues)

Parameters

fieldValues KeyValuePair<string, System.Collections.Generic.IList<T><string>>[]

The collection of field names and their values.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ImportFormDataFromFDF(Stream)

Imports the document's form data from a stream in FDF format.

public void ImportFormDataFromFDF(Stream stream)

Parameters

stream System.IO.Stream

The source stream.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ImportFormDataFromFDF(string)

Imports the document's form data from a file in FDF format.

public void ImportFormDataFromFDF(string fileName)

Parameters

fileName string

The source file.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ImportFormDataFromXFDF(Stream)

Imports the document's form data from a stream in XFDF format.

public void ImportFormDataFromXFDF(Stream stream)

Parameters

stream System.IO.Stream

The source stream.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ImportFormDataFromXFDF(string)

Imports the document's form data from a file in XFDF format.

public void ImportFormDataFromXFDF(string fileName)

Parameters

fileName string

The source file.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ImportFormDataFromXML(Stream)

Imports the document's form data from a stream in XML format.

public void ImportFormDataFromXML(Stream stream)

Parameters

stream System.IO.Stream

The source stream.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ImportFormDataFromXML(string)

Imports the document's form data from a file in XML format.

public void ImportFormDataFromXML(string fileName)

Parameters

fileName string

The source file.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Load(Stream, DecryptionOptions)

Loads the document from a specified input stream, overwriting the current content of the document. The stream should contain valid PDF data and must be kept open while reading or modifying the document. If the document is modified, it can be saved using the Save(string, bool) or Save(Stream, bool) methods.

public void Load(Stream stream, DecryptionOptions decryptionOptions)

Parameters

stream System.IO.Stream

The source System.IO.Stream object used to load the document content.

decryptionOptions DecryptionOptions

The DecryptionOptions object containing password and other decryption parameters.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Load(Stream, byte[])

Loads the current document from a specified input stream, overwriting the current content of the document. The stream should contain valid PDF data, and must be kept open while reading or modifying the document. If the document is modified, it can be saved using the Save(string, bool) or Save(Stream, bool) method.

public void Load(Stream stream, byte[] password)

Parameters

stream System.IO.Stream

The System.IO.Stream object used for loading the document content.

password byte[]

The password used to open the document.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Load(Stream, string)

Loads the current document from a specified input stream, overwriting the current content of the document. The stream should contain valid PDF data, and must be kept open while reading or modifying the document. If the document is modified, it can be saved using the Save(string, bool) or Save(Stream, bool) method.

public void Load(Stream stream, string password = null)

Parameters

stream System.IO.Stream

The System.IO.Stream object used for loading the document content.

password string

The password used to open the document.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

MergeWithDocument(GcPdfDocument, MergeDocumentOptions)

Merges all or some pages from a specified GcPdfDocument into the current document.

public void MergeWithDocument(GcPdfDocument sourceDoc, MergeDocumentOptions options = null)

Parameters

sourceDoc GcPdfDocument

The source document which is to be merged into the current document.

options MergeDocumentOptions

Options controlling what and how to merge.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

NewPage()

Adds a blank page to the document.

The size of the new page is defined by the value of the PageSize property.

If you want the new page to have a different size than the rest of the document, create the new page first, then set the Size property.

public Page NewPage()

Returns

Page

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

OnSavingDocument(float, bool)

Fires the SavingDocument event.

protected virtual bool OnSavingDocument(float progress, bool canCancel)

Parameters

progress float

The current saving progress from 0 to 1.

canCancel bool

Whether the operation can be canceled.

Returns

bool

true if operation was no canceled; otherwise false.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

OptimizeFonts()

Optimizes font usage by merging subsets of same fonts and by removing duplicate and unused fonts.

This method uses the default values from OptimizeFontsOptions.

public GcPdfDocument.FontsUsageStats OptimizeFonts()

Returns

GcPdfDocument.FontsUsageStats

A GcPdfDocument.FontsUsageStats object that contains statistics about fonts usage prior to the optimization.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

OptimizeFonts(OptimizeFontsOptions)

Optimizes font usage by merging subsets of same fonts, and by removing duplicate and unused fonts.

public GcPdfDocument.FontsUsageStats OptimizeFonts(OptimizeFontsOptions options)

Parameters

options OptimizeFontsOptions

An OptimizeFontsOptions object that specifies optimization options.

Returns

GcPdfDocument.FontsUsageStats

A GcPdfDocument.FontsUsageStats object that contains statistics about fonts usage prior to the optimization.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Redact(RedactAnnotation, RedactOptions)

Applies a specified RedactAnnotations to the current document.

public void Redact(RedactAnnotation redactAnnotation, RedactOptions redactOptions = null)

Parameters

redactAnnotation RedactAnnotation

The RedactAnnotation object to apply.

redactOptions RedactOptions

Specifies the additional redact options. If null, the default settings are used.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Redact(RedactOptions)

Applies all RedactAnnotations to the current document.

public void Redact(RedactOptions redactOptions = null)

Parameters

redactOptions RedactOptions

Specifies the additional redact options. If null, the default settings are used.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Redact(IList<RedactAnnotation>, RedactOptions)

Applies a list of specified RedactAnnotations to the current document.

public void Redact(IList<RedactAnnotation> redactAnnotations, RedactOptions redactOptions = null)

Parameters

redactAnnotations System.Collections.Generic.IList<T><RedactAnnotation>

The list of RedactAnnotation objects to apply.

redactOptions RedactOptions

Specifies the additional redact options. If null, the default settings are used.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

RegisterPdfObject(IPdfObject)

Registers an indirect PDF object with the current document and returns the ID of the object as a PdfObjID.

public PdfObjID RegisterPdfObject(IPdfObject ipo)

Parameters

ipo GrapeCity.Documents.Pdf.Spec.IPdfObject

The PdfIndirectObjectBase to add.

Returns

PdfObjID

The ID of the registered object.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

RemoveDuplicateImages()

Removes images with identical content from the current document.

public void RemoveDuplicateImages()

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

RemoveEmbeddedFonts()

Removes embedded fonts from the current document.

Please note that a PDF may display incorrectly after removing embedded fonts. Use with caution.

public void RemoveEmbeddedFonts()

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

ReplaceText(FindTextParams, string, OutputRange, Font, float?)

Replaces a specified text on all pages of the current document.

Note that the results may be affected by the current value of the RecognitionAlgorithm property.

public void ReplaceText(FindTextParams findTextParams, string newText, OutputRange searchRange = null, Font font = null, float? fontSize = null)

Parameters

findTextParams FindTextParams

The text to search for.

newText string

The replacement text.

searchRange OutputRange

The search scope.

font Font

The font to use on newText, if null the current font will be used.

fontSize float?

The font size to use on newText, if null the current font size will be used.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Save(Stream, SaveMode)

Saves the current PDF document to a System.IO.Stream using the specified save mode.

public void Save(Stream stream, SaveMode saveMode)

Parameters

stream System.IO.Stream

The System.IO.Stream object to use for saving the document.

saveMode SaveMode

The PDF saving mode.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Save(Stream, bool)

Saves the current PDF document to a System.IO.Stream, optionally using incremental update mode.

public void Save(Stream stream, bool incrementalUpdate)

Parameters

stream System.IO.Stream

The System.IO.Stream object to use for saving the document.

incrementalUpdate bool

Indicates whether the document should be saved using incremental update.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Save(Stream)

Saves the current PDF document to a System.IO.Stream using the default mode (no incremental update, not linearized).

public void Save(Stream stream)

Parameters

stream System.IO.Stream

The System.IO.Stream object to use for saving the document.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Save(string, SaveMode)

Saves the current PDF document to a file using the specified save mode.

public void Save(string fileName, SaveMode saveMode)

Parameters

fileName string

The name of the PDF file to create.

saveMode SaveMode

The PDF saving mode.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Save(string, bool)

Saves the current PDF document to a file, optionally using incremental update mode.

public void Save(string fileName, bool incrementalUpdate)

Parameters

fileName string

The name of the PDF file to create.

incrementalUpdate bool

Indicates whether the document should be saved using incremental update.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Save(string)

Saves the current PDF document to a file using the default mode (no incremental update, not linearized).

public void Save(string fileName)

Parameters

fileName string

The name of the PDF file to create.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsBmp(string, OutputRange, SaveAsImageOptions)

Saves the document pages as images in BMP format, one page per output file.

The filePath parameter is used as a .NET format string, with current page number (1-based) passed to it as the value to be formatted. Note that if filePath does not contain a format item (such as "{0}"), all pages will be saved into the same file name, the last page overwriting everything else.

public void SaveAsBmp(string filePath, OutputRange pageRange = null, SaveAsImageOptions options = null)

Parameters

filePath string

The output file path.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsBmp(string, ViewState, OutputRange, SaveAsImageOptions)

Saves the document pages as images in BMP format, one page per output file.

The filePath parameter is used as a .NET format string, with current page number (1-based) passed to it as the value to be formatted. Note that if filePath does not contain a format item (such as "{0}"), all pages will be saved into the same file name, the last page overwriting everything else.

public void SaveAsBmp(string filePath, ViewState viewState, OutputRange pageRange = null, SaveAsImageOptions options = null)

Parameters

filePath string

The output file path.

viewState ViewState

The document view state.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsGif(string, OutputRange, SaveAsImageOptions)

Saves the document pages as images in GIF format, one page per output file.

The filePath parameter is used as a .NET format string, with current page number (1-based) passed to it as the value to be formatted. Note that if filePath does not contain a format item (such as "{0}"), all pages will be saved into the same file name, the last page overwriting everything else.

public void SaveAsGif(string filePath, OutputRange pageRange = null, SaveAsImageOptions options = null)

Parameters

filePath string

The output file name.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsGif(string, ViewState, OutputRange, SaveAsImageOptions)

Saves the document pages as images in GIF format, one page per output file.

The filePath parameter is used as a .NET format string, with current page number (1-based) passed to it as the value to be formatted. Note that if filePath does not contain a format item (such as "{0}"), all pages will be saved into the same file name, the last page overwriting everything else.

public void SaveAsGif(string filePath, ViewState viewState, OutputRange pageRange = null, SaveAsImageOptions options = null)

Parameters

filePath string

The output file name.

viewState ViewState

The document view state.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsImage(OutputRange, SaveAsImageOptions, SaveAsImageDelegate)

Iterates other the document pages and generates a GcBitmap for each page in the pageRange.

public void SaveAsImage(OutputRange pageRange, SaveAsImageOptions options, GcPdfDocument.SaveAsImageDelegate saveMethod)

Parameters

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

saveMethod GcPdfDocument.SaveAsImageDelegate

The callback method called for each page.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsImage(ViewState, OutputRange, SaveAsImageOptions, SaveAsImageDelegate)

Iterates over the document pages and generates a GcBitmap for each page in the pageRange.

public void SaveAsImage(ViewState viewState, OutputRange pageRange, SaveAsImageOptions options, GcPdfDocument.SaveAsImageDelegate saveMethod)

Parameters

viewState ViewState

The ViewState used to determine what document content would be considered.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

saveMethod GcPdfDocument.SaveAsImageDelegate

The callback method called for each page.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsJpeg(string, OutputRange, SaveAsImageOptions)

Saves the document pages as images in JPEG format, one page per output file.

The filePath parameter is used as a .NET format string, with current page number (1-based) passed to it as the value to be formatted. Note that if filePath does not contain a format item (such as "{0}"), all pages will be saved into the same file name, the last page overwriting everything else.

public void SaveAsJpeg(string filePath, OutputRange pageRange = null, SaveAsImageOptions options = null)

Parameters

filePath string

The output file path.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsJpeg(string, ViewState, OutputRange, SaveAsImageOptions)

Saves the document pages as images in JPEG format, one page per output file.

The filePath parameter is used as a .NET format string, with current page number (1-based) passed to it as the value to be formatted. Note that if filePath does not contain a format item (such as "{0}"), all pages will be saved into the same file name, the last page overwriting everything else.

public void SaveAsJpeg(string filePath, ViewState viewState, OutputRange pageRange = null, SaveAsImageOptions options = null)

Parameters

filePath string

The output file path.

viewState ViewState

The document view state.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsPng(string, OutputRange, SaveAsImageOptions)

Saves the document pages as images in PNG format, one page per output file.

The filePath parameter is used as a .NET format string, with current page number (1-based) passed to it as the value to be formatted. Note that if filePath does not contain a format item (such as "{0}"), all pages will be saved into the same file name, the last page overwriting everything else.

public void SaveAsPng(string filePath, OutputRange pageRange = null, SaveAsImageOptions options = null)

Parameters

filePath string

The output file path.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsPng(string, ViewState, OutputRange, SaveAsImageOptions)

Saves the document pages as images in PNG format, one page per output file.

The filePath parameter is used as a .NET format string, with current page number (1-based) passed to it as the value to be formatted. Note that if filePath does not contain a format item (such as "{0}"), all pages will be saved into the same file name, the last page overwriting everything else.

public void SaveAsPng(string filePath, ViewState viewState, OutputRange pageRange = null, SaveAsImageOptions options = null)

Parameters

filePath string

The output file path.

viewState ViewState

The document view state.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsSvg(string, OutputRange, SaveAsImageOptions, XmlWriterSettings)

Saves the document pages as images in SVG format, one page per output file.

The filePath parameter is used as a .NET format string, with current page number (1-based) passed to it as the value to be formatted. Note that if filePath does not contain a format item (such as "{0}"), all pages will be saved into the same file name, the last page overwriting everything else.

public void SaveAsSvg(string filePath, OutputRange pageRange = null, SaveAsImageOptions options = null, XmlWriterSettings xmlSettings = null)

Parameters

filePath string

The output file path.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

xmlSettings System.Xml.XmlWriterSettings

The output XML formatting settings.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsSvg(string, ViewState, OutputRange, SaveAsImageOptions, XmlWriterSettings)

Saves the document pages as images in SVG format, one page per output file.

The filePath parameter is used as a .NET format string, with current page number (1-based) passed to it as the value to be formatted. Note that if filePath does not contain a format item (such as "{0}"), all pages will be saved into the same file name, the last page overwriting everything else.

public void SaveAsSvg(string filePath, ViewState viewState, OutputRange pageRange = null, SaveAsImageOptions options = null, XmlWriterSettings xmlSettings = null)

Parameters

filePath string

The output file path.

viewState ViewState

The document view state.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

xmlSettings System.Xml.XmlWriterSettings

The output XML formatting settings.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsTiff(Stream, OutputRange, SaveAsImageOptions, TiffFrameSettings)

Saves the document pages as images to a stream in TIFF format, one page per frame.

public void SaveAsTiff(Stream stream, OutputRange pageRange = null, SaveAsImageOptions options = null, TiffFrameSettings frameSettings = null)

Parameters

stream System.IO.Stream

The output stream.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

frameSettings TiffFrameSettings

Frame settings that are used for encoding the TIFF frames.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsTiff(Stream, ViewState, OutputRange, SaveAsImageOptions, TiffFrameSettings)

Saves the document pages as images to a stream in TIFF format, one page per frame.

public void SaveAsTiff(Stream stream, ViewState viewState, OutputRange pageRange = null, SaveAsImageOptions options = null, TiffFrameSettings frameSettings = null)

Parameters

stream System.IO.Stream

The output stream.

viewState ViewState

The document view state.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

frameSettings TiffFrameSettings

Frame settings that are used for encoding the TIFF frames.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsTiff(string, OutputRange, SaveAsImageOptions, TiffFrameSettings)

Saves the document pages as images to a file in TIFF format, one page per frame.

public void SaveAsTiff(string filePath, OutputRange pageRange = null, SaveAsImageOptions options = null, TiffFrameSettings frameSettings = null)

Parameters

filePath string

The output file path.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

frameSettings TiffFrameSettings

Frame settings that are used for encoding the TIFF frames.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SaveAsTiff(string, ViewState, OutputRange, SaveAsImageOptions, TiffFrameSettings)

Saves the document pages as images to a file in TIFF format, one page per frame.

public void SaveAsTiff(string filePath, ViewState viewState, OutputRange pageRange = null, SaveAsImageOptions options = null, TiffFrameSettings frameSettings = null)

Parameters

filePath string

The output file path.

viewState ViewState

The document view state.

pageRange OutputRange

The range of pages that should be saved.

options SaveAsImageOptions

Options that allow customizing the output images.

frameSettings TiffFrameSettings

Frame settings that are used for encoding the TIFF frames.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

SetLicenseKey(string)

Sets the license key.

public static void SetLicenseKey(string key)

Parameters

key string

The license key to set, or null to remove any previously set key.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Sign(SignatureProperties, Stream, SaveMode)

Signs and saves the current document to a stream. Note that stream must support read and seek operations.

public void Sign(SignatureProperties signatureProperties, Stream stream, SaveMode saveMode)

Parameters

signatureProperties SignatureProperties

Properties of the signature used to sign the document.

stream System.IO.Stream

The output stream (must support read and seek operations).

saveMode SaveMode

The PDF saving mode.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Sign(SignatureProperties, Stream, bool)

Signs and saves the current document to a file. Note that stream must support read and seek operations.

public void Sign(SignatureProperties signatureProperties, Stream stream, bool incrementalUpdate)

Parameters

signatureProperties SignatureProperties

Properties of the signature used to sign the document.

stream System.IO.Stream

The output stream (must support read and seek operations).

incrementalUpdate bool

Indicates whether the document should be saved using incremental update.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Sign(SignatureProperties, Stream)

Signs and saves the current document to a stream. Note that stream must support read and seek operations.

public void Sign(SignatureProperties signatureProperties, Stream stream)

Parameters

signatureProperties SignatureProperties

Properties of the signature used to sign the document.

stream System.IO.Stream

The output stream (must support read and seek operations).

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Sign(SignatureProperties, string, SaveMode)

Signs and saves the current document to a file.

public void Sign(SignatureProperties signatureProperties, string fileName, SaveMode saveMode)

Parameters

signatureProperties SignatureProperties

Properties of the signature used to sign the document.

fileName string

The name of the PDF file to create.

saveMode SaveMode

The PDF saving mode.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Sign(SignatureProperties, string, bool)

Signs and saves the current document to a stream.

public void Sign(SignatureProperties signatureProperties, string fileName, bool incrementalUpdate)

Parameters

signatureProperties SignatureProperties

Properties of the signature used to sign the document.

fileName string

The name of the PDF file to create.

incrementalUpdate bool

Indicates whether the document should be saved using incremental update.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Sign(SignatureProperties, string)

Signs and saves the current document to a file.

public void Sign(SignatureProperties signatureProperties, string fileName)

Parameters

signatureProperties SignatureProperties

Properties of the signature used to sign the document.

fileName string

The name of the PDF file to create.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

StartDoc(Stream)

Starts document generation in sequential mode.

In this mode, the content of the document is written directly into the underlying stream as soon as it is created, without the use of temporary files. When all content has been added, call EndDoc() to finish creating the document.

public void StartDoc(Stream stream)

Parameters

stream System.IO.Stream

The stream to which the PDF document will be written.

Remarks

Sequential mode may provide better performance, but it does not allow modifying the already created pages (which is possible when StartDoc(Stream) is not called, and the document is saved by Save(Stream, bool) or Save(string, bool) after all content has been added instead.)

EndDoc() Save(Stream, bool) Save(string, bool)

TimeStamp(TimeStampProperties, Stream, SaveMode)

Adds a document time stamp and saves the current document to a stream.

public void TimeStamp(TimeStampProperties timeStampProperties, Stream stream, SaveMode saveMode)

Parameters

timeStampProperties TimeStampProperties

The time stamp properties.

stream System.IO.Stream

The output stream. The stream must support read and seek operations.

saveMode SaveMode

The PDF saving mode.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

TimeStamp(TimeStampProperties, Stream)

Adds a document time stamp and saves the current document to a stream.

public void TimeStamp(TimeStampProperties timeStampProperties, Stream stream)

Parameters

timeStampProperties TimeStampProperties

The time stamp properties.

stream System.IO.Stream

The output stream. The stream must support read and seek operations.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

TimeStamp(TimeStampProperties, string, SaveMode)

Adds a document time stamp and saves the current document to a file.

public void TimeStamp(TimeStampProperties timeStampProperties, string fileName, SaveMode saveMode)

Parameters

timeStampProperties TimeStampProperties

The time stamp properties.

fileName string

The name of the PDF file to create.

saveMode SaveMode

The PDF saving mode.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

TimeStamp(TimeStampProperties, string)

Adds a document time stamp and saves the current document to a file.

public void TimeStamp(TimeStampProperties timeStampProperties, string fileName)

Parameters

timeStampProperties TimeStampProperties

The time stamp properties.

fileName string

The name of the PDF file to create.

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.

Events

SavingDocument

Occurs periodically when the document is being saved or exported. Can be used to implement a progress indicator.

public event LongOperationEventHandler SavingDocument

Event Type

LongOperationEventHandler

Remarks

To create a PDF document, create an instance of the GcPdfDocument class.

Two approaches are possible for adding content and saving the document:

  • Direct modeIn this mode, you add pages to the document and draw on them (see below) in arbitrary order. In particular, you can modify pages that have been already created. When done, use Save(Stream, bool) or Save(string, bool) method to save the document. This mode is convenient but uses temporary files, so is somewhat less efficient than sequential mode described next.
  • Sequential mode To use this mode, you call StartDoc(Stream) prior to any other operations on the document. You can then add pages and draw on them, but you can only draw on the last (current) page. All content is immediately added to the underlying stream without the use of temporary files. To complete creating the document, you must call EndDoc().

The pages of the document are accessible via the Pages collection. To add content, use Graphics property to get a GcGraphics for a page. (In sequential mode, only the currently last page of the document can be drawn on.) You can then use that graphics object to draw the desired content.