[]
        
(Showing Draft Content)

C1.C1Preview.Export.Exporter

Exporter Class

The abstract base class for all exporter classes. An instance of an Exporter derived class is used to export a document.

Namespace: C1.C1Preview.Export
Assembly: C1.PrintDocument.8.dll
Syntax
public abstract class Exporter

Constructors

Name Description
Exporter()

Initializes a new instance of the Exporter class.

Fields

Name Description
_printDocument

Represents a document for export.

Properties

Name Description
Document

Gets or sets the object representing the document that will be exported by the current exporter's Export(string) or Export(Stream) methods.

DocumentInfo

Gets or sets the DocumentInfo object associated with the Document assigned to the current exporter.

DocumentInfoFormClass

Gets or sets the type of form that is used to edit the fields of DocumentInfo class. That form can be invoked from the export options form (OptionsFormClass). The form's type must be assignable to DocumentInfoForm.

ExportProvider

Gets an instance of a class derived from ExportProvider describing the export format associated with the current exporter. That instance can be used to retrieve static information about the current export format such as format description or default extension.

OptionsFormClass

Gets or sets the type of form that is used to edit export options. That form is shown when the Export(string) or the Export(Stream) method is called if ShowOptions is true. The form's type must be assignable to the type specified by the DefaultOptionsFormClass property.

OptionsFormClassName

Gets or sets the type name of form that is used to edit export options. That form is shown when the Export(string) or the Export(Stream) method is called if ShowOptions is true. The form's type must be assignable to the type specified by the DefaultOptionsFormClass property.

OutputFileName

Gets the output file name. This property is set when the Export(string) method is called.

OutputFiles

Gets the list of files which were generated by the call to Export(string). Typically exporters produce a single file (e.g. RtfExporter, XlsExporter), but some (like HtmlExporter and EmfExporter) may produce several files all of which can be then accessed through this property.

OutputStream

Gets the output stream. This property is set when the Export(Stream) method is called.

Preview

Gets or sets a value indicating whether the exported document should be opened after exporting it to a disk file (using the Export(string) method). The application used to open the file is determined by the OS shell.

Range

Gets or sets the range of pages that is to be exported.

RangeFormClass

Gets or sets the type of form that is used to enter the export output range. That form can be invoked from the export options form (OptionsFormClass). The form's type must be assignable to OutputRangeForm.

ReferenceGraphics

Specifies the Graphics object used by export. For example, that Graphics can be used to convert EmfPlusDual or EmfPlusOnly metafiles to EmfOnly. If this property is null, the screen device context is used.

ShowOptions

Gets or sets a value indicating whether the options dialog should be shown to the user before exporting the document.

Methods

Name Description
CanPreviewOutputFile()

Tests whether OutputFileName can be previewed. This (base) implementation uses FindExecutable API to find an appropriate executable, and returns a value indicating whether it has been found or not.

If you override this, you must also override PreviewOutputFile().

Clear()

Resets the internal state of the exporter and all its public properties.

ConvertEmfPlusToEmfOnly()

Indicates whether page metafiles of types EmfPlusDual and EmfPlusOnly should be converted to EmfOnly type before exporting. The base implementation returns false.

CopyPropertiesFromOptionsForm(ExportOptionsFormBase)

Copies the options from the specified export options form to corresponding properties on the current exporter. Can be overridden in a derived class to handle format-specific options.

CopyPropertiesToOptionsForm(ExportOptionsFormBase)

Copies the properties of the current exporter to corresponding user-editable options of the specified export options form. Can be overridden in a derived class to handle format-specific options.

EnsureGeneratedDocument()

Makes sure the Document has been generated if it is an instance of the C1PrintDocument class.

EnumeratePages()

Processes (exports) all pages in the range to be exported.

Export(Stream)

Exports the object specified by the Document property on the current exporter to the specified Stream.

Note that some export formats do not support exporting to streams. Test the value returned by the CanExportToStream property on ExportProvider prior to calling this method.

Export(string)

Exports the object specified by the Document property on the current exporter to the specified file.

GetPageFileName(int)

Gets the file name (with path) for the file containing the specified page. Used only for export formats that save a page per file (e.g. TIFF).

InternalExport()

Performs export to a disk file or to a stream. The destination (file or stream) is determined by which of the properties (OutputFileName or OutputStream) is non-null when this method executes.

OnDocumentChanged()

Called after the Document property has been changed. If you override this, make sure this base method also gets called.

PreparePageDrawParams(ref PageDrawParams)

Set page draw parameters.

PreviewOutputFile()

Previews OutputFileName. This (base) implementation uses System.Diagnostics.Process.Start() to open the output file.

Override this if you override CanPreviewOutputFile().

ProcessPage(Metafile, C1MetafileInfo, int, bool)

Exports a page of a document represented by a Metafile.

Reset()

Resets the internal state of the exporter.

ShowOptionsDialog()

Displays a dialog that allows the user to edit the export options.

Events

Name Description
LongOperation

Occurs periodically during export. Allows to show progress and give the end user the ability to cancel the operation.