ImageDoc

An implementation of the ICpDocument interface which handles bit-image based docuemnts.
ImageDoc documents can be created from a bit-image input source, such as Jpeg, PNG, BMP, GIF data, and can be output as Jpeg, PNG or native printer graphic command data.
Images can also be dithered and scaled to fit the output device, if specified through the JobConversionOptions property.

NameSpace: StarMicronics.CloudPrnt.Documents

Syntax

public class ImageDoc : ICpDocument

Constructors

ImageDoc(Stream, String)

Construct an ImageDoc object form an input Stream source.
The stream may provide the input image as Jpeg, PNG, BMP or GIF format data.

Declaration

public ImageDoc(Stream input, string mediaFormat)

Parameters

Type

Name

Description

System.IO.Stream

input

Stream object which the data will be loaded from.

System.String

mediaFormat

Specify the input data type as an IANA/MIME format media type.

ImageDoc(String)

onstruct a new ImageDoc object from an external image file.
Source files may be Jpeg, PNG, BMP or GIF format images.

Declaration

public ImageDoc(string fileName)

Parameters

Type

Name

Description

System.String

fileName

Name of the input source file.

Properties

JobConversionOptions

Specify parameters that will be used to direct the conversion of a print job.

Declaration

public ConversionOptions JobConversionOptions { get; set; }

Property Value

Type

Description

ConversionOptions

NativeFormat

Returns the input image format in IANA/MIME media type format, that was used to create this document.
Depending on the constructor method and input source, this may be empty.

Declaration

public string NativeFormat { get; }

Property Value

Type

Description

System.String

OutputFormats

Provide a list of media types that this document can be converted to.

Declaration

public string[] OutputFormats { get; }

Property Value

Type

Description

System.String[]

Methods

convertTo(String, Stream)

Convert the document to the requested format, and write to the specified stream.

Declaration

public void convertTo(string requestFormat, Stream stream)

Parameters

Type

Name

Description

System.String

requestFormat

Requires output format, specified as an IANA/MIME format media type. This must be a type that is supported for output by this particular ImageDoc object, as listed by the OutputFormats property.

System.IO.Stream

stream

stream that the output data will be written to.