GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PdfContentGroup Class

    Namespace:
    GemBox.Pdf.Content
    Assembly:
    GemBox.Pdf.dll

    Represents a group of PDF content elements that are independent from the rest of the surrounding elements.

    • C#
    • VB.NET
    public class PdfContentGroup : PdfVisualContentElement
    Public Class PdfContentGroup
        Inherits PdfVisualContentElement
    Inheritance:
    System.Object
    PdfContentElement
    PdfVisualContentElement
    PdfContentGroup
    Derived
    PdfContent

    Properties

    Bounds

    Gets the upright bounds of the PdfContentGroup.

    • C#
    • VB.NET
    public override PdfQuad Bounds { get; }
    Public Overrides ReadOnly Property Bounds As PdfQuad
    Property Value
    PdfQuad

    The upright bounds of the PdfContentGroup.

    Overrides
    PdfVisualContentElement.Bounds
    Remarks

    This member, although exposed as a property for easier debugging, performs complex calculations, so instead of accessing it frequently, cache its result instead.

    Elements

    Gets the content elements such as text, paths and external objects (images and forms) contained directly in this group.

    • C#
    • VB.NET
    public PdfContentElementCollection Elements { get; }
    Public ReadOnly Property Elements As PdfContentElementCollection
    Property Value
    PdfContentElementCollection

    The content elements such as text, paths and external objects (images and forms) contained directly in this group.

    ElementType

    Gets the Group value.

    • C#
    • VB.NET
    public override PdfContentElementType ElementType { get; }
    Public Overrides ReadOnly Property ElementType As PdfContentElementType
    Property Value
    PdfContentElementType

    The Group value.

    Overrides
    PdfContentElement.ElementType

    Methods

    DrawAnnotation(PdfAnnotation)

    Draws the annotation.

    • C#
    • VB.NET
    public void DrawAnnotation(PdfAnnotation annotation)
    Public Sub DrawAnnotation(annotation As PdfAnnotation)
    Parameters
    annotation
    PdfAnnotation

    The annotation to be drawn.

    Exceptions
    System.ArgumentNullException

    annotation is null.

    DrawAnnotation(PdfAnnotation, PdfMatrix)

    Draws the annotation with the specified transformation.

    • C#
    • VB.NET
    public void DrawAnnotation(PdfAnnotation annotation, PdfMatrix transform)
    Public Sub DrawAnnotation(annotation As PdfAnnotation, transform As PdfMatrix)
    Parameters
    annotation
    PdfAnnotation

    The annotation to be drawn.

    transform
    PdfMatrix

    The transformation from the new (transformed) coordinate system to the original (untransformed) coordinate system.

    Exceptions
    System.ArgumentNullException

    annotation is null.

    DrawImage(PdfImage, PdfMatrix)

    Draws image with the specified transformation.

    • C#
    • VB.NET
    public void DrawImage(PdfImage image, PdfMatrix transform)
    Public Sub DrawImage(image As PdfImage, transform As PdfMatrix)
    Parameters
    image
    PdfImage

    The image to be drawn.

    transform
    PdfMatrix

    The transformation from the new (transformed) coordinate system to the original (untransformed) coordinate system.

    Exceptions
    System.ArgumentNullException

    image is null.

    DrawImage(PdfImage, PdfPoint)

    Draws image at the specified location.

    • C#
    • VB.NET
    public void DrawImage(PdfImage image, PdfPoint origin)
    Public Sub DrawImage(image As PdfImage, origin As PdfPoint)
    Parameters
    image
    PdfImage

    The image to be drawn.

    origin
    PdfPoint

    The location of the bottom-left corner of the PdfImage.

    Exceptions
    System.ArgumentNullException

    image is null.

    DrawImage(PdfImage, PdfPoint, PdfSize)

    Draws image at the specified location and of the specified size.

    • C#
    • VB.NET
    public void DrawImage(PdfImage image, PdfPoint origin, PdfSize size)
    Public Sub DrawImage(image As PdfImage, origin As PdfPoint, size As PdfSize)
    Parameters
    image
    PdfImage

    The image to be drawn.

    origin
    PdfPoint

    The location of the bottom-left corner of the PdfImage.

    size
    PdfSize

    The size of the PdfImage.

    Exceptions
    System.ArgumentNullException

    image is null.

    DrawText(PdfFormattedText, PdfMatrix)

    Draws formatted text with the specified transformation.

    • C#
    • VB.NET
    public void DrawText(PdfFormattedText formattedText, PdfMatrix transform)
    Public Sub DrawText(formattedText As PdfFormattedText, transform As PdfMatrix)
    Parameters
    formattedText
    PdfFormattedText

    The formatted text to be drawn.

    transform
    PdfMatrix

    The transformation from the new (transformed) coordinate system to the original (untransformed) coordinate system.

    Exceptions
    System.ArgumentNullException

    formattedText is null.

    DrawText(PdfFormattedText, PdfPoint)

    Draws formatted text at the specified location.

    • C#
    • VB.NET
    public void DrawText(PdfFormattedText formattedText, PdfPoint origin)
    Public Sub DrawText(formattedText As PdfFormattedText, origin As PdfPoint)
    Parameters
    formattedText
    PdfFormattedText

    The formatted text to be drawn.

    origin
    PdfPoint

    The location of the bottom-left corner of the PdfFormattedText.

    Exceptions
    System.ArgumentNullException

    formattedText is null.

    DrawText(PdfFormattedTextLine, PdfPoint)

    Draws formatted text line at the specified location.

    • C#
    • VB.NET
    public void DrawText(PdfFormattedTextLine formattedTextLine, PdfPoint origin)
    Public Sub DrawText(formattedTextLine As PdfFormattedTextLine, origin As PdfPoint)
    Parameters
    formattedTextLine
    PdfFormattedTextLine

    The formatted text line to be drawn.

    origin
    PdfPoint

    The location of the bottom-left corner of the PdfFormattedTextLine.

    Exceptions
    System.ArgumentNullException

    formattedTextLine is null.

    GetText()

    Gets the snapshot of text contained in this PdfContentGroup using the Default text options.

    • C#
    • VB.NET
    public PdfText GetText()
    Public Function GetText As PdfText
    Returns
    PdfText

    The snapshot of text contained in this PdfContentGroup extracted using the Default text options.

    Remarks

    The PdfText is a snapshot and if the underlying PDF content is changed, that change won't be visible in the PdfText, instead PdfText should be retrieved again to get the actual snapshot.

    GetText(PdfTextOptions)

    Gets the snapshot of text contained in this PdfContentGroup using the specified text options.

    • C#
    • VB.NET
    public PdfText GetText(PdfTextOptions options)
    Public Function GetText(options As PdfTextOptions) As PdfText
    Parameters
    options
    PdfTextOptions

    The options used for extracting text from this PdfContentGroup.

    Returns
    PdfText

    The snapshot of text contained in this PdfContentGroup extracted using the specified text options.

    Remarks

    The PdfText is a snapshot and if the underlying PDF content is changed, that change won't be visible in the PdfText, instead PdfText should be retrieved again to get the actual snapshot.

    Exceptions
    System.ArgumentNullException

    options is null.

    ToString()

    Returns a Unicode text contained in this PdfContentGroup.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A Unicode text contained in this PdfContentGroup.

    Overrides
    System.Object.ToString()

    Inherited Properties

    Collection

    Gets the PdfContentElementCollection that the PdfContentElement belongs to.

    (Inherited from PdfContentElement)

    Format

    Gets or sets the formatting properties applied to the PdfVisualContentElement.

    (Inherited from PdfVisualContentElement)

    Next

    Gets the next PdfContentElement in the Collection.

    (Inherited from PdfContentElement)

    Previous

    Gets the previous PdfContentElement in the Collection.

    (Inherited from PdfContentElement)

    Transform

    Gets or sets the transformation from the new (transformed) coordinate system to the original (untransformed) coordinate system.

    All coordinates used after the transformation are expressed in the transformed coordinate system.

    tip

    Before setting the Transform, move PdfVisualContentElement into its own PdfContentGroup so that the transformation is confined to that PdfContentGroup and doesn't have any effect on PdfContentElements outside that PdfContentGroup.

    (Inherited from PdfVisualContentElement)

    Examples

    Reading example
    Content Groups example
    Image transformations example
    Import Images example
    Text transformations example
    Writing example

    See Also

    PDF Specification ISO 32000-1:2008, section '8.4.2 Graphics State Stack'
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.