Attached Structure

Represents an attached

public struct Attached : ValueType
Public Structure Attached
    Inherits ValueType

Inheritance: ObjectValueTypeAttached

Examples

The following example shows how to use an artifact.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements

Module MyModule
		
    Sub Main()
		
        ' Create a PDF Document
        Dim MyDocument As Document = New Document() 
		
        ' Specify document as a tagged PDF
        MyDocument.Tag = New TagOptions()

        ' Create a page and add it to the document
        Dim MyPage As Page = New Page()
        MyDocument.Pages.Add(MyPage)

        ' Create a background image
        Dim MyBackgroundImage As BackgroundImage = New BackgroundImage("C:\MyImage.jpg")

        ' Create an artifact
        Dim MyArtifact As Artifact = New Artifact(ArtifactType.Background, New Attached(Edge.Left, Edge.Bottom, Edge.Right, Edge.Top))

        ' Add bounding box to the artifact
        MyArtifact.SetBoundingBox(New BoundingBox(MyPage.Dimensions.Edge.Left, MyPage.Dimensions.Edge.Bottom, MyPage.Dimensions.Edge.Right, MyPage.Dimensions.Edge.Top))

        ' Tag the background image with the artifact
        MyBackgroundImage.Tag = MyArtifact

        ' Add the background image to the page
        MyPage.Elements.Add(MyBackgroundImage)

        ' Save the PDF
        MyDocument.Draw("C:\MyDocument.pdf")
		
    End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;

public class Example
{
    public static void CreatePDF(string outputPath, string imagePath)
    {
        // Create a PDF Document
        Document document = new Document();

        // Specify document as a tagged PDF
        document.Tag = new TagOptions();

        // Create a page and add it to the document
        Page page = new Page();
        document.Pages.Add(page);

        // Create a background image
        BackgroundImage backgroundImage = new BackgroundImage(imagePath);

        // Create an artifact
        Artifact artifact = new Artifact(ArtifactType.Background, new Attached(Edge.Left, Edge.Bottom, Edge.Right, Edge.Top));

        // Add bounding box to the artifact
        artifact.SetBoundingBox(new BoundingBox(page.Dimensions.Edge.Left, page.Dimensions.Edge.Bottom, page.Dimensions.Edge.Right, page.Dimensions.Edge.Top));

        // Tag the background image with the artifact
        backgroundImage.Tag = artifact;

        // Add the background image to the page
        page.Elements.Add(backgroundImage);

        //Save the PDF
        document.Draw(outputPath);
    }
}

Constructors

Attached(Edge)Initializes a new instance of the Attached class.
Attached(Edge, Edge)Initializes a new instance of the Attached class.
Attached(Edge, Edge, Edge)Initializes a new instance of the Attached class.
Attached(Edge, Edge, Edge, Edge)Initializes a new instance of the Attached class.

Methods

Equals(Object)Indicates whether this instance and a specified object are equal.
(Inherited from ValueType)
GetHashCode()Returns the hash code for this instance.
(Inherited from ValueType)
GetType()Gets the Type of the current instance.
(Inherited from Object)
SetEdge(Edge)Sets the value to the edge.
ToString()Returns the fully qualified type name of this instance.
(Inherited from ValueType)

See Also

ceTe.DynamicPDF

In this topic