[]
        
(Showing Draft Content)

C1.C1Pdf.C1PdfDocument

C1PdfDocument Class

Provides methods to create and save Pdf documents.

Implements
Namespace: C1.C1Pdf
Assembly: C1.C1Pdf.4.8.dll
Syntax
[ToolboxBitmap(typeof(C1PdfDocument), "C1PdfDocument.png")]
[Obsolete("This library is obsolete. Please use C1.Win.Pdf (part of C1.Pdf for .NET Standard) instead.")]
public class C1PdfDocument : C1PdfDocumentBase, IComponent, IDisposable
Remarks

This library is obsolete and may be removed in the future. Please plan migration to C1.Win.Pdf multitarget library which contains all the features of this library.

When you create an instance of the C1PdfDocument 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
CurrentPage

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

Landscape

Gets or sets the default page orientation for the document.

MaxHeaderBookmarkLevel

Gets or sets the maximum header level to create bookmarks for when rendering HTML text.

PageSize

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

PaperKind

Gets or sets the default page size for the document.

ParseEmfPlus

Gets or sets the flag to convert EMF PLUS metafiles to EMF ONLY metafiles or no.

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, AttachmentIconEnum, Color)

Adds a stream-based attachment to the current page.

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

Adds a stream-based attachment to the document.

AddAttachment(string, RectangleF)

Adds a file attachment to the current page.

AddAttachment(string, RectangleF, AttachmentIconEnum, Color)

Adds a file attachment to the current page.

AddAttachment(string, RectangleF, int, AttachmentIconEnum, 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.

ClipPath(PointF[], byte[])

Start clipping use a path defined by points and types.

ClipStop()

Stop path clipping.

Dispose(bool)

Releases all resources used by the Control.

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.

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.

DrawGlyphs(string, short[], float[], FontSubSet, float, Brush, PointF, Matrix, float, bool)

Draws a string by glyphs.

DrawImage(Image, RectangleF)

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

DrawImage(Image, RectangleF, ContentAlignment, ImageSizeModeEnum)

Draws the specified 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 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.

DrawMetafile(Metafile, RectangleF, RectangleF, bool, GraphicsUnit)

Draw metafile.

DrawPath(Pen, GraphicsPath)

Draws a path defined by a GraphicsPath object.

DrawPath(Pen, GraphicsPath, bool)

Draws a path defined by a GraphicsPath object.

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.

DrawString(string, Font, Brush, PointF)

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

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

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

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

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

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

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

DrawString(string, Font, Brush, RectangleF)

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

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

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

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

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

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

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

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

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

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

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

DrawString(string, Font, Color, PointF)

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

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

Draws the specified text string at the specified point with the specified Brush 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 Brush 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 Brush, 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 Brush and Font objects.

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

Draws the specified text string in the specified rectangle with the specified Brush 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 Brush 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 Brush 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 Brush 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 Brush and Font, using the formatting attributes of the specified StringFormat object and specified character width coefficient.

DrawStringHtml(string, Font, Brush, RectangleF)

Draws an HTML string in the specified rectangle with the specified Brush and Font objects.

DrawStringHtml(string, Font, Brush, RectangleF, int)

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

DrawStringRtf(string, Font, Brush, RectangleF)

Draws an RTF string in the specified rectangle with the specified Brush and Font objects.

DrawStringRtf(string, Font, Brush, RectangleF, int)

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

FillArc(Brush, RectangleF, float, float)

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

FillArc(Color, RectangleF, float, float)

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

FillEllipse(Brush, RectangleF)

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

FillEllipse(Brush, 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.

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(Brush, GraphicsPath)

Fills a path defined by a GraphicsPath object.

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

Fills a path defined by points and types.

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

Fills a path defined by points and types.

FillPie(Brush, RectangleF, float, float)

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

FillPie(Color, RectangleF, float, float)

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

FillPolygon(Brush, PointF[], FillMode)

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

FillPolygon(Color, PointF[], FillMode)

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

FillRectangle(Brush, RectangleF)

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

FillRectangle(Brush, RectangleF, SizeF)

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

FillRectangle(Brush, float, float, float, float)

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

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.

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, int)

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

MeasureStringHtml(string, Font)

Measures an HTML string when drawn with a given Font object.

MeasureStringHtml(string, Font, float)

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

MeasureStringRtf(string, Font)

Measures an RTF string when drawn with a given Font object.

MeasureStringRtf(string, Font, float)

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

ResetClipRect()

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

SetClipRect(RectangleF)

Sets the clipping area.

SetTransform(Matrix)

Sets the PDF transform (write the matrix).