[]
        
(Showing Draft Content)

C1.Pdf.C1PdfDocument

C1PdfDocument Class

Provides methods to create and save PDF documents.

Implements
IFlowRendering
IRendering
Namespace: C1.Pdf
Assembly: C1.Pdf.dll
Syntax
public class C1PdfDocument : C1PdfDocumentBase, IComponent, IDisposable, IFlowDocument, IFlowRendering, IRendering
Remarks
<p>When you create an instance of the <xref href="C1.Pdf.C1PdfDocument" data-throw-if-not-resolved="false"></xref> class, you 

get a PDF document with a single blank page. You can then add content to the page using methods similar to those available in the .NET Graphics class (DrawRectangle, DrawString, etc.).

You can add new pages using the NewPage() method, and select the page size using the PaperKind or PageSize properties.

When the document is ready, you can save it to a file or a stream using the Save(string) method.

The coordinate system used by C1PdfDocument is based on points, with the origin located at the top left corner of the page. You can retrieve the page rectangle (measured in points) using the PageRectangle property.

Constructors

Name Description
C1PdfDocument()

Creates a new instance of the C1PdfDocument class.

C1PdfDocument(PaperKind)

Creates a new instance of the C1PdfDocument class.

C1PdfDocument(PaperKind, bool)

Creates a new instance of the C1PdfDocument class.

C1PdfDocument(SizeF)

Creates a new instance of the C1PdfDocument class.

Properties

Name Description
ClipBounds

Gets clipping area as rectangle bounds.

ClipRect

Gets clipping area as rectangle bounds.

CurrentPage

Gets or sets the index of the current page within the document.

Landscape

Gets or sets the default page orientation for the document.

PageCount

Gets the count of pages in the document.

PageSize

Gets or sets the default page size for the document (in points).

PaperKind

Gets or sets the default page size for the document.

RotateAngle

Gets or sets the rotate angle for drawing simple objects for the document in degree (from -360 to 360).

Methods

Name Description
AddAttachment(string, byte[], RectangleF, AttachmentIcon, Color)

Adds a stream-based attachment to the current page.

AddAttachment(string, byte[], RectangleF, int, AttachmentIcon, Color)

Adds a stream-based attachment to the document.

AddAttachment(string, RectangleF)

Adds a file attachment to the current page.

AddAttachment(string, RectangleF, AttachmentIcon, Color)

Adds a file attachment to the current page.

AddAttachment(string, RectangleF, int, AttachmentIcon, Color)

Adds a file attachment to the document.

AddBookmark(string, int, double)

Adds a bookmark to the current page.

AddBookmark(string, int, double, bool)

Adds a bookmark to the current page.

AddBookmark(string, int, int, double)

Adds a bookmark to the specified page.

AddBookmark(string, int, string)

Adds a bookmark to the specified page.

AddField(PdfFieldBase, RectangleF)

Adds an AcroField to the current page.

AddField(PdfFieldBase, int, RectangleF)

Adds an AcroField to the document.

Adds a hyperlink to the current page.

Adds a hyperlink to the document.

AddNote(PdfNoteBase, RectangleF)

Adds an annotation item to the current page.

AddNote(PdfNoteBase, int, RectangleF)

Adds an annotation item to the document.

AddTarget(string, RectangleF)

Adds a hyperlink target to the current page.

AddTarget(string, int, RectangleF)

Adds a hyperlink target to the document.

BeginPath()

Begin a path.

ClipPath(PointF[], byte[])

Start clipping use a path defined by points and types.

ClipStop()

Stop path clipping.

CloseFigure()

Close the path figure.

DrawArc(Pen, RectangleF, float, float)

Draws an arc defined by an ellipse specified by a rectangle structure and two radial lines.

DrawBezier(Pen, PointF, PointF, PointF, PointF)

Draws a Bezier spline defined by four point structures.

DrawBeziers(Pen, PointF[])

Draws a series of Bezier splines from an array of point structures.

DrawDocument(C1WordDocument, RectangleF, float)

Draws a Word document in the specified rectangle.

DrawEllipse(Pen, RectangleF)

Draws an ellipse defined by a bounding rectangle specified by a rectangle structure.

DrawEllipse(Pen, float, float, float, float)

Draws an ellipse defined by a bounding rectangle specified by a coordinate pair, a width, and a height.

DrawFile(Stream, string, RectangleF, float)

Draws a stream content to PDF document.

DrawFile(string, RectangleF, float)

Draws a file content to PDF document.

DrawGlyphs(string, short[], float[], FontSubSet, float, Color, PointF, Matrix3x2, float, bool)

Draws a string by glyphs.

DrawImage(Image, RectangleF)

Draws the specified GrapeCity.Documents.Drawing.Image object at the specified location, stretching it to fit the destination rectangle.

DrawImage(Image, RectangleF, ContentAlignment, ImageSizeMode)

Draws the specified GrapeCity.Documents.Drawing.Image object at the specified location, adjusting the image size as specified by the align and mode parameters.

DrawImage(Image, RectangleF, RectangleF)

Draws the specified GrapeCity.Documents.Drawing.Image object at the specified location, clipping the output to the given clipping rectangle.

DrawLine(Pen, PointF, PointF)

Draws a line connecting two point structures.

DrawLine(Pen, float, float, float, float)

Draws a line connecting the two points specified by coordinate pairs.

DrawLines(Pen, PointF[])

Draws a series of line segments that connect an array of point structures.

DrawPath(Pen, PointF[], byte[], bool)

Draws a path defined by points and types.

DrawPie(Pen, RectangleF, float, float)

Draws a pie shape defined by an ellipse specified by a rectangle structure and two radial lines.

DrawPolygon(Pen, PointF[])

Draws a polygon defined by an array of point structures.

DrawRectangle(Pen, RectangleF)

Draws a rectangle specified by a rectangle structure.

DrawRectangle(Pen, RectangleF, SizeF)

Draws a rounded rectangle specified by rectangle and size structures.

DrawRectangle(Pen, float, float, float, float)

Draws a rectangle specified by a coordinate pair, a width, and a height.

DrawSheet(XLSheet, RectangleF, float)

Draws an Excel sheet in the specified rectangle.

DrawString(string, Font, Color, PointF)

Draws the specified text string at the specified point with the specified Color and Font objects.

DrawString(string, Font, Color, PointF, StringFormat)

Draws the specified text string at the specified point with the specified Color and Font objects using the formatting attributes of the specified StringFormat object.

DrawString(string, Font, Color, PointF, StringFormat, float)

Draws the specified text string at the specified point with the specified Color and Font objects using the formatting attributes of the specified StringFormat object and specified width coefficient of text characters.

DrawString(string, Font, Color, PointF, float)

Draws the specified text string at the specified point with the specified Color, Font objects and specified width coefficient of text characters.

DrawString(string, Font, Color, RectangleF)

Draws the specified text string in the specified rectangle with the specified Color and Font objects.

DrawString(string, Font, Color, RectangleF, StringFormat)

Draws the specified text string in the specified rectangle with the specified Color and Font objects using the formatting attributes of the specified StringFormat object.

DrawString(string, Font, Color, RectangleF, StringFormat, float)

Draws the specified text string in the specified rectangle with the specified Color and Font objects using the formatting attributes of the specified StringFormat object.

DrawString(string, Font, Color, RectangleF, int)

Draws the specified text string in the specified rectangle with the specified Color and Font objects using the formatting attributes of the specified StringFormat object.

DrawString(string, Font, Color, RectangleF, int, StringFormat)

Draws the specified text string in the specified rectangle with the specified Color and Font objects using the formatting attributes of the specified StringFormat object.

DrawString(string, Font, Color, RectangleF, int, StringFormat, float)

Draws the specified text string in the specified rectangle, with the specified Color and Font, using the formatting attributes of the specified StringFormat object and specified character width coefficient.

DrawStringHtml(string, Font, Color, RectangleF, float)

Draws an HTML string in the specified rectangle with the specified GrapeCity.Documents.Drawing.Brush and Font objects, starting at a given offset within the string.

DrawStringRtf(string, Font, Color, RectangleF, float)

Draws an RTF string in the specified rectangle with the specified Color and Font objects, starting at a given offset within the string.

DrawSvg(string, RectangleF)

Draw SVG data with content alignment.

DrawSvg(string, RectangleF, ContentAlignment, ImageSizeMode)

Draws the specified SVG data at the specified location, adjusting the SVG size as specified by the align and mode parameters.

DrawSvg(string, RectangleF, RectangleF)

Draw SVG data with content alignment.

EndPath()

End the path.

FillArc(Color, RectangleF, float, float)

Fills an arc defined by an ellipse specified by a rectangle structure and two radial lines.

FillEllipse(Color, RectangleF)

Fills the interior of an ellipse defined by a bounding rectangle specified by a rectangle structure.

FillEllipse(Color, float, float, float, float)

Fills the interior of an ellipse defined by a bounding rectangle specified by a coordinate pair, a width, and a height.

FillPath(Color, PointF[], byte[], bool)

Fills a path defined by points and types.

FillPie(Color, RectangleF, float, float)

Fills a pie shape defined by an ellipse specified by a rectangle structure and two radial lines.

FillPolygon(Color, PointF[], FillMode)

Fills a polygon defined by an array of point structures using the specified fill mode.

FillRectangle(Color, RectangleF)

Fills the interior of a rectangle specified by a rectangle structure.

FillRectangle(Color, RectangleF, SizeF)

Fills the interior of a rounded rectangle specified by rectangle and size structures.

FillRectangle(Color, float, float, float, float)

Fills the interior of a rectangle specified by a coordinate pair, a width, and a height.

FillStroke(bool, bool, bool, FillMode, bool)

Fill or/and stroke the path figure.

FillStroke(bool, bool, bool, bool)

Fill or/and stroke the path figure.

GetPaperSizeInPoints(PaperKind)

Convert GrapeCity.Documents.Common.PaperKind PaperKind into SizeF (in points).

MeasureDocument(C1WordDocument, float)

Measures a Word document into a rectangle with the specified width.

MeasureString(string, Font)

Measures the specified string when drawn with a given Font object.

MeasureString(string, Font, float)

Measures the specified string when drawn with a given Font object into a rectangle with the specified width.

MeasureString(string, Font, float, StringFormat)

Measures the specified string when drawn with the specified Font object and formatted with the specified StringFormat object.

MeasureString(string, Font, float, StringFormat, int)

Measures the specified string when drawn with the specified Font object and formatted with the specified StringFormat object.

MeasureStringHtml(string, Font, float)

Measures a HTML string when drawn with a given Font object into a rectangle with the specified width.

MeasureStringRtf(string, Font, float)

Measures an RTF string when drawn with a given Font object into a rectangle with the specified width.

PopClip()

Pop the clip rectangle.

PushClipPath(double[], double[], byte[])

Push the clip path defined by points and types.

PushClipRect(double, double, double, double)

Push the clip rectangle.

PushClipRect(RectangleF)

Push the clip rectangle.

ResetClipRect()

Restores the clipping area to the state after the last call to SetClipRect(RectangleF).

RestartPath()

Restart the path.

SetClipRect(RectangleF)

Sets the clipping area.

SetFillMode(FillMode)

Sets default fill mode.

SetResources(params object[])

Sets default resources (pen, color, and font).

SetTransform(Matrix3x2)

Sets the PDF transform (write the matrix).