[]
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
Gets the size of the drawing area.
public SizeF CanvasSize { get; }
Gets the GcPdfDocument object owning this graphics.
public GcPdfDocument Doc { get; }
For internal use. Gets the features supported by this graphics.
public override GcGraphicsFeatures Features { get; }
For internal use.
public override bool ImageCanBeDisposedAfterDrawing { get; }
Gets the resolution of the current graphics.
public override float Resolution { get; set; }
Gets or sets the SoftMaskBase object defining current Soft Mask.
public SoftMaskBase SoftMask { get; set; }
Gets or sets an ITextLayoutHandler object which will receive notifications from the GcPdfGraphics when TextLayout is rendered.
public ITextLayoutHandler TextLayoutHandler { get; set; }
Gets or sets the current transformation matrix. The default is Identity matrix.
public override Matrix3x2 Transform { get; set; }
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)
layer
OptionalContentGroupThe OptionalContentGroup that defines the target layer.
Begins rendering to the specified layer
.
The EndLayer() method must be called to end rendering to the specified layer.
public void BeginLayer(OptionalContentMembership layer)
layer
OptionalContentMembershipThe OptionalContentMembership that defines the target layer.
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)
layerName
stringThe name of the target layer.
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)
tag
TagBaseThe TagBase object indicating the role or significance of the marked-content element to the processing application.
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)
markedContentTag
stringThe tag indicating the role or significance of the marked-content element to the processing application.
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)
srcLayer
IGcTransparencyGroupsrcBounds
RectangledstPoint
Pointalpha
float?For internal use. Creates a IGcTransparencyGroup compatible with this graphics. This group can be used later for:
public override IGcTransparencyGroup CreateTransparencyGroup(Rectangle size, bool isolated, bool knockout, bool softMask)
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)
layer
IGcTransparencyGroupmaskType
TransparencyMaskTypemaskBounds
Rectanglefilter
IGcTransparencyMaskFilterDisposes the current graphics.
protected override void Dispose(bool disposing)
disposing
boolDraws a FormXObject using specified bounds and image alignment.
public void DrawForm(FormXObject fxo, RectangleF destBounds, RectangleF? clipBounds, ImageAlign align)
fxo
FormXObjectThe FormXObject to draw.
destBounds
RectangleFThe destination rectangle.
clipBounds
RectangleF?The clipping rectangle, or null for no clipping.
align
ImageAlignThe image alignment.
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)
fxo
FormXObjectThe FormXObject to draw.
destBounds
RectangleFThe destination rectangle.
clipBounds
RectangleF?The clipping rectangle, or null for no clipping.
align
ImageAlignThe image alignment.
imageBounds
RectangleF[]OUT: The actual bounds of the drawn image(s) (can be more than one if the image is tiled).
For internal use only.
public override void DrawGlyphs(Font font, ushort[] glyphs, float[] glyphAdvances, string[] glyphUtf16, int length, Color color, Matrix3x2 matrix)
font
Fontglyphs
ushort[]glyphAdvances
float[]glyphUtf16
string[]length
intcolor
Colormatrix
Matrix3x2For 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)
font
Fontglyphs
ushort[]glyphAdvances
float[]glyphVx
float[]glyphVy
float[]glyphUtf16
string[]length
intcolor
Colormatrix
Matrix3x2Ends rendering to the layer specified by a previous call to BeginLayer(string), BeginLayer(OptionalContentGroup) or BeginLayer(OptionalContentMembership).
public void EndLayer()
Ends Marked Content. Writes EMC operator to content stream.
public void EndMarkedContent()
For internal use. Returns the current blend mode.
protected override BlendMode GetBlendMode()
For internal use.
protected override IClipRegion InternalCreateClipRegion(IPath graphicsPath)
graphicsPath
IPathFor internal use.
protected override IClipRegion InternalCreateClipRegion(RectangleF bounds)
bounds
RectangleFFor internal use.
protected override IPath InternalCreatePath()
For internal use.
protected override void InternalDrawEllipse(RectangleF bounds, Pen pen)
bounds
RectangleFpen
PenFor internal use.
protected override void InternalDrawImage(RectangleF dstRect, IImage image, float opacity)
dstRect
RectangleFimage
IImageopacity
floatFor internal use.
protected override void InternalDrawLine(PointF p1, PointF p2, Pen pen)
For internal use.
protected override void InternalDrawLines(PointF[] points, Pen pen)
For internal use.
protected override void InternalDrawPath(IPath path, Pen pen)
For internal use.
protected override void InternalDrawPolygon(PointF[] points, Pen pen)
For internal use.
protected override void InternalDrawRectangle(RectangleF bounds, Pen pen)
bounds
RectangleFpen
PenFor internal use.
protected override void InternalDrawRoundRect(RectangleF bounds, float radiusX, float radiusY, Pen pen)
bounds
RectangleFradiusX
floatradiusY
floatpen
PenFor internal use.
protected override void InternalDrawTextLayout(TextLayout textLayout, PointF location)
textLayout
TextLayoutlocation
PointFFor internal use.
protected override void InternalFillEllipse(RectangleF bounds, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)
bounds
RectangleFbrush
BrushbrushBounds
RectangleF?brushTransform
Matrix3x2?For internal use.
protected override void InternalFillEllipse(RectangleF bounds, Color color)
bounds
RectangleFcolor
ColorFor internal use.
protected override void InternalFillPath(IPath path, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)
path
IPathbrush
BrushbrushBounds
RectangleF?brushTransform
Matrix3x2?For internal use.
protected override void InternalFillPath(IPath path, Color color)
For internal use.
protected override void InternalFillPolygon(PointF[] points, Brush brush, FillMode fillMode, RectangleF? brushBounds, Matrix3x2? brushTransform)
points
PointF[]brush
BrushfillMode
FillModebrushBounds
RectangleF?brushTransform
Matrix3x2?For internal use.
protected override void InternalFillPolygon(PointF[] points, Color color, FillMode fillMode)
For internal use.
protected override void InternalFillRectangle(RectangleF bounds, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)
bounds
RectangleFbrush
BrushbrushBounds
RectangleF?brushTransform
Matrix3x2?For internal use.
protected override void InternalFillRectangle(RectangleF bounds, Color color)
bounds
RectangleFcolor
ColorFor internal use.
protected override void InternalFillRoundRect(RectangleF bounds, float radiusX, float radiusY, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)
bounds
RectangleFradiusX
floatradiusY
floatbrush
BrushbrushBounds
RectangleF?brushTransform
Matrix3x2?For internal use.
protected override void InternalFillRoundRect(RectangleF bounds, float radiusX, float radiusY, Color color)
bounds
RectangleFradiusX
floatradiusY
floatcolor
ColorFor internal use.
protected override void InternalRemoveClip(IClipRegion clipRegion)
clipRegion
IClipRegionFor internal use.
protected override void InternalSetClip(IClipRegion clipRegion)
clipRegion
IClipRegionIndicates whether this graphics implementation supports a specified blend mode.
The following blend modes are supported by GcPdfGraphics:
public override bool IsBlendModeSupported(BlendMode blendMode)
blendMode
BlendModeThe blend mode to check.
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)
interpolationMode
InterpolationModeThe interpolation mode to check.
true if the specified interpolation mode is supported by the current graphics, false otherwise.
Stops redirecting drawing operations to the transparency layer that was created by the last PushTransparencyLayer(RectangleF?, float) call.
public override void PopTransparencyLayer()
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)
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
floatAn opacity value that is applied uniformly to all drawings in the layer when compositing to the backplate.
For internal use. Sets the current blend mode.
protected override void SetBlendMode(BlendMode value)
value
BlendModeFor 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)
nativeMask
object