[]
        
(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
object
GcPdfGraphics
Implements
System.IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Extension Methods

Properties

CanvasSize

Gets the size of the drawing area.

public SizeF CanvasSize { get; }

Property Value

System.Drawing.SizeF

Doc

Gets the GcPdfDocument object owning this graphics.

public GcPdfDocument Doc { get; }

Property Value

GcPdfDocument

Features

public override GcGraphicsFeatures Features { get; }

Property Value

GrapeCity.Documents.Drawing.GcGraphicsFeatures

ImageCanBeDisposedAfterDrawing

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

System.Numerics.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?)

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

Parameters

srcLayer GrapeCity.Documents.Drawing.IGcTransparencyGroup
srcBounds System.Drawing.Rectangle
dstPoint System.Drawing.Point
alpha float?

CreateTransparencyGroup(Rectangle, bool, bool, bool)

public override IGcTransparencyGroup CreateTransparencyGroup(Rectangle size, bool isolated, bool knockout, bool softMask)

Parameters

size System.Drawing.Rectangle
isolated bool
knockout bool
softMask bool

Returns

GrapeCity.Documents.Drawing.IGcTransparencyGroup

CreateTransparencyMask(IGcTransparencyGroup, TransparencyMaskType, Rectangle)

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

Parameters

layer GrapeCity.Documents.Drawing.IGcTransparencyGroup
maskType GrapeCity.Documents.Drawing.TransparencyMaskType
maskBounds System.Drawing.Rectangle

Returns

object

Dispose(bool)

Disposes the current graphics.

protected override void Dispose(bool disposing)

Parameters

disposing bool

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 System.Drawing.RectangleF

The destination rectangle.

clipBounds System.Drawing.RectangleF?

The clipping rectangle, or null for no clipping.

align ImageAlign

The image alignment.

imageBounds System.Drawing.RectangleF[]

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

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 System.Drawing.RectangleF

The destination rectangle.

clipBounds System.Drawing.RectangleF?

The clipping rectangle, or null for no clipping.

align ImageAlign

The image alignment.

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 System.Drawing.Color
matrix System.Numerics.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 System.Drawing.Color
matrix System.Numerics.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 System.Drawing.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 System.Drawing.RectangleF
pen Pen

InternalDrawImage(RectangleF, IImage, float)

For internal use.

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

Parameters

dstRect System.Drawing.RectangleF
image IImage
opacity float

InternalDrawLine(PointF, PointF, Pen)

For internal use.

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

Parameters

p1 System.Drawing.PointF
p2 System.Drawing.PointF
pen Pen

InternalDrawLines(PointF[], Pen)

For internal use.

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

Parameters

points System.Drawing.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 System.Drawing.PointF[]
pen Pen

InternalDrawRectangle(RectangleF, Pen)

For internal use.

protected override void InternalDrawRectangle(RectangleF bounds, Pen pen)

Parameters

bounds System.Drawing.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 System.Drawing.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 System.Drawing.PointF

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

For internal use.

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

Parameters

bounds System.Drawing.RectangleF
brush Brush
brushBounds System.Drawing.RectangleF?
brushTransform System.Numerics.Matrix3x2?

InternalFillEllipse(RectangleF, Color)

For internal use.

protected override void InternalFillEllipse(RectangleF bounds, Color color)

Parameters

bounds System.Drawing.RectangleF
color System.Drawing.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 System.Drawing.RectangleF?
brushTransform System.Numerics.Matrix3x2?

InternalFillPath(IPath, Color)

For internal use.

protected override void InternalFillPath(IPath path, Color color)

Parameters

path IPath
color System.Drawing.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 System.Drawing.PointF[]
brush Brush
fillMode FillMode
brushBounds System.Drawing.RectangleF?
brushTransform System.Numerics.Matrix3x2?

InternalFillPolygon(PointF[], Color, FillMode)

For internal use.

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

Parameters

points System.Drawing.PointF[]
color System.Drawing.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 System.Drawing.RectangleF
brush Brush
brushBounds System.Drawing.RectangleF?
brushTransform System.Numerics.Matrix3x2?

InternalFillRectangle(RectangleF, Color)

For internal use.

protected override void InternalFillRectangle(RectangleF bounds, Color color)

Parameters

bounds System.Drawing.RectangleF
color System.Drawing.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 System.Drawing.RectangleF
radiusX float
radiusY float
brush Brush
brushBounds System.Drawing.RectangleF?
brushTransform System.Numerics.Matrix3x2?

InternalFillRoundRect(RectangleF, float, float, Color)

For internal use.

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

Parameters

bounds System.Drawing.RectangleF
radiusX float
radiusY float
color System.Drawing.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 System.Drawing.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)

public override void SetTransparencyMask(object nativeMask)

Parameters

nativeMask object