[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.GcPdfGraphics

Class GcPdfGraphics

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

Represents a graphics object that can be used to draw on a PDF page.

The origin (0,0) is in the top left corner of the page, the axis go right and down.

All coordinates and sizes are expressed in printer points (1/72 of an inch) by default. This can be changed using the Resolution property.

public class GcPdfGraphics : GcGraphics, IDisposable
Inheritance
GcPdfGraphics
Implements
Inherited Members
Extension Methods

Properties

CanvasSize

Gets the size of the drawing area.

public SizeF CanvasSize { get; }

Property Value

SizeF

Doc

Gets the GcPdfDocument object owning this graphics.

public GcPdfDocument Doc { get; }

Property Value

GcPdfDocument

Features

For internal use. Gets the features supported by this graphics.

public override GcGraphicsFeatures Features { get; }

Property Value

GcGraphicsFeatures

ImageCanBeDisposedAfterDrawing

For internal use.

public override bool ImageCanBeDisposedAfterDrawing { get; }

Property Value

bool

Resolution

Gets the resolution of the current graphics.

public override float Resolution { get; set; }

Property Value

float

SoftMask

Gets or sets the SoftMaskBase object defining current Soft Mask.

public SoftMaskBase SoftMask { get; set; }

Property Value

SoftMaskBase

TextLayoutHandler

Gets or sets an ITextLayoutHandler object which will receive notifications from the GcPdfGraphics when TextLayout is rendered.

public ITextLayoutHandler TextLayoutHandler { get; set; }

Property Value

ITextLayoutHandler

Transform

Gets or sets the current transformation matrix. The default is Identity matrix.

public override Matrix3x2 Transform { get; set; }

Property Value

Matrix3x2

Methods

BeginLayer(OptionalContentGroup)

Begins rendering to the specified layer. That layer should already exist in the Groups collection of the current document's OptionalContent.

The EndLayer() method must be called to end rendering to the specified layer.

public void BeginLayer(OptionalContentGroup layer)

Parameters

layer OptionalContentGroup

The OptionalContentGroup that defines the target layer.

BeginLayer(OptionalContentMembership)

Begins rendering to the specified layer.

The EndLayer() method must be called to end rendering to the specified layer.

public void BeginLayer(OptionalContentMembership layer)

Parameters

layer OptionalContentMembership

The OptionalContentMembership that defines the target layer.

BeginLayer(string)

Begins rendering to a layer specified by layerName. That name should match the Name of an existing OptionalContentGroup in the Groups collection of the current document's OptionalContent.

The EndLayer() method must be called to end rendering to the specified layer.

public void BeginLayer(string layerName)

Parameters

layerName string

The name of the target layer.

BeginMarkedContent(TagBase)

Begins Marked Content. Writes (BMC or BDC) operator to content stream, each call of BeginMarkedContent(string) should be enclosed with EndMarkedContent().

public void BeginMarkedContent(TagBase tag)

Parameters

tag TagBase

The TagBase object indicating the role or significance of the marked-content element to the processing application.

BeginMarkedContent(string)

Begins Marked Content. Writes (BMC or BDC) operator to content stream, each call of BeginMarkedContent(string) should be enclosed with EndMarkedContent().

public void BeginMarkedContent(string markedContentTag)

Parameters

markedContentTag string

The tag indicating the role or significance of the marked-content element to the processing application.

Composite(IGcTransparencyGroup, Rectangle, Point, float?)

For internal use. Composites this GcGraphics and the IGcTransparencyGroup created with the CreateTransparencyGroup(Rectangle, bool, bool, bool) method.

public override void Composite(IGcTransparencyGroup srcLayer, Rectangle srcBounds, Point dstPoint, float? alpha)

Parameters

srcLayer IGcTransparencyGroup
srcBounds Rectangle
dstPoint Point
alpha float?

CreateTransparencyGroup(Rectangle, bool, bool, bool)

For internal use. Creates a IGcTransparencyGroup compatible with this graphics. This group can be used later for:

  1. Compose with graphics using the Composite(IGcTransparencyGroup, Rectangle, Point, float?) method
  2. Create a transparency mask from this group using the CreateTransparencyMask(IGcTransparencyGroup, TransparencyMaskType, Rectangle, IGcTransparencyMaskFilter) method Note! If the transparency group supports IDisposable interface it will be automatically disposed after usage.
public override IGcTransparencyGroup CreateTransparencyGroup(Rectangle size, bool isolated, bool knockout, bool softMask)

Parameters

size Rectangle
isolated bool
knockout bool
softMask bool

Returns

IGcTransparencyGroup

CreateTransparencyMask(IGcTransparencyGroup, TransparencyMaskType, Rectangle, IGcTransparencyMaskFilter)

For internal use. Creates a transparency mask from a IGcTransparencyGroup, this mask can be specified for this graphics using SetTransparencyMask(object) method. Note! If the transparency mask supports IDisposable interface it will be automatically disposed after usage.

public override object CreateTransparencyMask(IGcTransparencyGroup layer, TransparencyMaskType maskType, Rectangle maskBounds, IGcTransparencyMaskFilter filter)

Parameters

layer IGcTransparencyGroup
maskType TransparencyMaskType
maskBounds Rectangle
filter IGcTransparencyMaskFilter

Returns

object

Dispose(bool)

Disposes the current graphics.

protected override void Dispose(bool disposing)

Parameters

disposing bool

DrawForm(FormXObject, RectangleF, RectangleF?, ImageAlign)

Draws a FormXObject using specified bounds and image alignment.

public void DrawForm(FormXObject fxo, RectangleF destBounds, RectangleF? clipBounds, ImageAlign align)

Parameters

fxo FormXObject

The FormXObject to draw.

destBounds RectangleF

The destination rectangle.

clipBounds RectangleF?

The clipping rectangle, or null for no clipping.

align ImageAlign

The image alignment.

DrawForm(FormXObject, RectangleF, RectangleF?, ImageAlign, out RectangleF[])

Draws a FormXObject using specified bounds and image alignment.

The output parameter imageBounds receives the actual bounds of the drawn object(s).

public void DrawForm(FormXObject fxo, RectangleF destBounds, RectangleF? clipBounds, ImageAlign align, out RectangleF[] imageBounds)

Parameters

fxo FormXObject

The FormXObject to draw.

destBounds RectangleF

The destination rectangle.

clipBounds RectangleF?

The clipping rectangle, or null for no clipping.

align ImageAlign

The image alignment.

imageBounds RectangleF[]

OUT: The actual bounds of the drawn image(s) (can be more than one if the image is tiled).

DrawGlyphs(Font, ushort[], float[], string[], int, Color, Matrix3x2)

For internal use only.

public override void DrawGlyphs(Font font, ushort[] glyphs, float[] glyphAdvances, string[] glyphUtf16, int length, Color color, Matrix3x2 matrix)

Parameters

font Font
glyphs ushort[]
glyphAdvances float[]
glyphUtf16 string[]
length int
color Color
matrix Matrix3x2

DrawVertGlyphs(Font, ushort[], float[], float[], float[], string[], int, Color, Matrix3x2)

For internal use only.

public override void DrawVertGlyphs(Font font, ushort[] glyphs, float[] glyphAdvances, float[] glyphVx, float[] glyphVy, string[] glyphUtf16, int length, Color color, Matrix3x2 matrix)

Parameters

font Font
glyphs ushort[]
glyphAdvances float[]
glyphVx float[]
glyphVy float[]
glyphUtf16 string[]
length int
color Color
matrix Matrix3x2

EndLayer()

Ends rendering to the layer specified by a previous call to BeginLayer(string), BeginLayer(OptionalContentGroup) or BeginLayer(OptionalContentMembership).

public void EndLayer()

EndMarkedContent()

Ends Marked Content. Writes EMC operator to content stream.

public void EndMarkedContent()

GetBlendMode()

For internal use. Returns the current blend mode.

protected override BlendMode GetBlendMode()

Returns

BlendMode

InternalCreateClipRegion(IPath)

For internal use.

protected override IClipRegion InternalCreateClipRegion(IPath graphicsPath)

Parameters

graphicsPath IPath

Returns

IClipRegion

InternalCreateClipRegion(RectangleF)

For internal use.

protected override IClipRegion InternalCreateClipRegion(RectangleF bounds)

Parameters

bounds RectangleF

Returns

IClipRegion

InternalCreatePath()

For internal use.

protected override IPath InternalCreatePath()

Returns

IPath

InternalDrawEllipse(RectangleF, Pen)

For internal use.

protected override void InternalDrawEllipse(RectangleF bounds, Pen pen)

Parameters

bounds RectangleF
pen Pen

InternalDrawImage(RectangleF, IImage, float)

For internal use.

protected override void InternalDrawImage(RectangleF dstRect, IImage image, float opacity)

Parameters

dstRect RectangleF
image IImage
opacity float

InternalDrawLine(PointF, PointF, Pen)

For internal use.

protected override void InternalDrawLine(PointF p1, PointF p2, Pen pen)

Parameters

p1 PointF
p2 PointF
pen Pen

InternalDrawLines(PointF[], Pen)

For internal use.

protected override void InternalDrawLines(PointF[] points, Pen pen)

Parameters

points PointF[]
pen Pen

InternalDrawPath(IPath, Pen)

For internal use.

protected override void InternalDrawPath(IPath path, Pen pen)

Parameters

path IPath
pen Pen

InternalDrawPolygon(PointF[], Pen)

For internal use.

protected override void InternalDrawPolygon(PointF[] points, Pen pen)

Parameters

points PointF[]
pen Pen

InternalDrawRectangle(RectangleF, Pen)

For internal use.

protected override void InternalDrawRectangle(RectangleF bounds, Pen pen)

Parameters

bounds RectangleF
pen Pen

InternalDrawRoundRect(RectangleF, float, float, Pen)

For internal use.

protected override void InternalDrawRoundRect(RectangleF bounds, float radiusX, float radiusY, Pen pen)

Parameters

bounds RectangleF
radiusX float
radiusY float
pen Pen

InternalDrawTextLayout(TextLayout, PointF)

For internal use.

protected override void InternalDrawTextLayout(TextLayout textLayout, PointF location)

Parameters

textLayout TextLayout
location PointF

InternalFillEllipse(RectangleF, Brush, RectangleF?, Matrix3x2?)

For internal use.

protected override void InternalFillEllipse(RectangleF bounds, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)

Parameters

bounds RectangleF
brush Brush
brushBounds RectangleF?
brushTransform Matrix3x2?

InternalFillEllipse(RectangleF, Color)

For internal use.

protected override void InternalFillEllipse(RectangleF bounds, Color color)

Parameters

bounds RectangleF
color Color

InternalFillPath(IPath, Brush, RectangleF?, Matrix3x2?)

For internal use.

protected override void InternalFillPath(IPath path, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)

Parameters

path IPath
brush Brush
brushBounds RectangleF?
brushTransform Matrix3x2?

InternalFillPath(IPath, Color)

For internal use.

protected override void InternalFillPath(IPath path, Color color)

Parameters

path IPath
color Color

InternalFillPolygon(PointF[], Brush, FillMode, RectangleF?, Matrix3x2?)

For internal use.

protected override void InternalFillPolygon(PointF[] points, Brush brush, FillMode fillMode, RectangleF? brushBounds, Matrix3x2? brushTransform)

Parameters

points PointF[]
brush Brush
fillMode FillMode
brushBounds RectangleF?
brushTransform Matrix3x2?

InternalFillPolygon(PointF[], Color, FillMode)

For internal use.

protected override void InternalFillPolygon(PointF[] points, Color color, FillMode fillMode)

Parameters

points PointF[]
color Color
fillMode FillMode

InternalFillRectangle(RectangleF, Brush, RectangleF?, Matrix3x2?)

For internal use.

protected override void InternalFillRectangle(RectangleF bounds, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)

Parameters

bounds RectangleF
brush Brush
brushBounds RectangleF?
brushTransform Matrix3x2?

InternalFillRectangle(RectangleF, Color)

For internal use.

protected override void InternalFillRectangle(RectangleF bounds, Color color)

Parameters

bounds RectangleF
color Color

InternalFillRoundRect(RectangleF, float, float, Brush, RectangleF?, Matrix3x2?)

For internal use.

protected override void InternalFillRoundRect(RectangleF bounds, float radiusX, float radiusY, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)

Parameters

bounds RectangleF
radiusX float
radiusY float
brush Brush
brushBounds RectangleF?
brushTransform Matrix3x2?

InternalFillRoundRect(RectangleF, float, float, Color)

For internal use.

protected override void InternalFillRoundRect(RectangleF bounds, float radiusX, float radiusY, Color color)

Parameters

bounds RectangleF
radiusX float
radiusY float
color Color

InternalRemoveClip(IClipRegion)

For internal use.

protected override void InternalRemoveClip(IClipRegion clipRegion)

Parameters

clipRegion IClipRegion

InternalSetClip(IClipRegion)

For internal use.

protected override void InternalSetClip(IClipRegion clipRegion)

Parameters

clipRegion IClipRegion

IsBlendModeSupported(BlendMode)

Indicates whether this graphics implementation supports a specified blend mode.

The following blend modes are supported by GcPdfGraphics:

public override bool IsBlendModeSupported(BlendMode blendMode)

Parameters

blendMode BlendMode

The blend mode to check.

Returns

bool

true if the specified blend mode is supported by the current graphics, false otherwise.

IsInterpolationModeSupported(InterpolationMode)

Indicates whether this graphics implementation supports a specified interpolation mode.

NearestNeighbor is the only interpolation mode supported by GcPdfGraphics.

public override bool IsInterpolationModeSupported(InterpolationMode interpolationMode)

Parameters

interpolationMode InterpolationMode

The interpolation mode to check.

Returns

bool

true if the specified interpolation mode is supported by the current graphics, false otherwise.

PopTransparencyLayer()

Stops redirecting drawing operations to the transparency layer that was created by the last PushTransparencyLayer(RectangleF?, float) call.

public override void PopTransparencyLayer()

PushTransparencyLayer(RectangleF?, float)

Adds a transparency layer to the GcPdfGraphics so that it receives all subsequent drawing operations until PopTransparencyLayer() is called.

public override void PushTransparencyLayer(RectangleF? contentBounds, float opacity)

Parameters

contentBounds RectangleF?

The content bounds of the transparency layer. Content won't render outside these bounds. When set to null, the content bounds are effectively taken to be the bounds of the current GcPdfGraphics.

opacity float

An opacity value that is applied uniformly to all drawings in the layer when compositing to the backplate.

SetBlendMode(BlendMode)

For internal use. Sets the current blend mode.

protected override void SetBlendMode(BlendMode value)

Parameters

value BlendMode

SetTransparencyMask(object)

For internal use. Sets a transparency mask for subsequent drawing operations, mask was created with IGcGraphicsLayer.CreateTransparencyMask(). Note! mask can be null, in this case mask should be removed.

public override void SetTransparencyMask(object nativeMask)

Parameters

nativeMask object