Attached Structure
- Namespace: ceTe.DynamicPDF
- Assemblies: DynamicPDF.NETFramework40.dll, DynamicPDF.NETStandard20.dll
Represents an attached
public struct Attached : ValueType
Public Structure Attached
Inherits ValueType
Inheritance: Object → ValueType → Attached
Licensing
This class is a DynamicPDF Generator Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:
- DynamicPDF Generator for .NET Enterprise Edition
- DynamicPDF Merger for .NET Enterprise Edition
- DynamicPDF ReportWriter for .NET Enterprise Edition
- DynamicPDF Core Suite for .NET Enterprise Edition
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.
public Attached(Edge value)
Public Sub New (value As Edge)
Parameters
- value: Edge
Value of the edge.
Attached(Edge, Edge)
Initializes a new instance of the Attached class.
public Attached(Edge value1, Edge value2)
Public Sub New (value1 As Edge, value2 As Edge)
Parameters
- value1: Edge
Value of the edge.
- value2: Edge
Value of the edge.
Attached(Edge, Edge, Edge)
Initializes a new instance of the Attached class.
public Attached(Edge value1, Edge value2, Edge value3)
Public Sub New (value1 As Edge, value2 As Edge, value3 As Edge)
Parameters
- value1: Edge
Value of the edge.
- value2: Edge
Value of the edge.
- value3: Edge
Value of the edge.
Attached(Edge, Edge, Edge, Edge)
Initializes a new instance of the Attached class.
public Attached(Edge value1, Edge value2, Edge value3, Edge value4)
Public Sub New (value1 As Edge, value2 As Edge, value3 As Edge, value4 As Edge)
Parameters
- value1: Edge
Value of the edge.
- value2: Edge
Value of the edge.
- value3: Edge
Value of the edge.
- value4: Edge
Value of the edge.
Methods
Equals(Object)
Indicates whether this instance and a specified object are equal. (Inherited from ValueType)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
Another object to compare to.
Returns
true if and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance. (Inherited from ValueType)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A 32-bit signed integer that is the hash code for this instance.
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
SetEdge(Edge)
Sets the value to the edge.
public void SetEdge(Edge value)
Sub SetEdge(value As Edge)
Parameters
- value: Edge
Value of the edge.
ToString()
Returns the fully qualified type name of this instance. (Inherited from ValueType)
public string ToString()
Function ToString() As String
Returns
A String containing a fully qualified type name.