Class PdfAttached
Represents the logically attached artifcat on the page.
Inheritance
System.Object
PdfAttached
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.Pdf
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfAttached
Examples
//Create new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new page to the document.
PdfPage page = document.Pages.Add();
//Create new instance for PDF artifact.
PdfArtifact artifact = new PdfArtifact();
//Set artifact type.
artifact.ArtifactType = PdfArtifactType.Layout;
//Set the attachement for the artifact.
artifact.Attached = new PdfAttached(PdfEdge.Left);
//Set bounding box for the artifact.
artifact.BoundingBox = new RectangleF(0, 0, 100, 100);
//Create new instance for the PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
//Set tag for the element.
element.PdfTag = artifact;
//Create new instance for the PDF font.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Create new instance for the PDF brush.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element on the PDF page.
element.Draw(page, new RectangleF(0, 0, page.Graphics.ClientSize.Width / 2, 200));
//Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Create new instance for PDF artifact.
Dim artifact As PdfArtifact = New PdfArtifact()
'Set artifact type.
artifact.ArtifactType = PdfArtifactType.Layout
'Set the attachement for the artifact.
artifact.Attached = New PdfAttached(PdfEdge.Left)
'Set the bounding box for the artifact.
artifact.BoundingBox = New RectangleF(0, 0, 100, 100)
'Create new instance for the PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
'Set tag for the element.
element.PdfTag = artifact
'Create new instance for the PDF font.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Create new instance for the PDF brush.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element on the PDF page.
element.Draw(page, New RectangleF(0, 0, page.Graphics.ClientSize.Width / 2, 200))
'Save and close the document.
document.Save("Output.pdf")
document.Close(True)
Constructors
PdfAttached(PdfEdge)
Initialize the PdfAttached
Declaration
public PdfAttached(PdfEdge pageEdge)
Parameters
Type | Name | Description |
---|---|---|
PdfEdge | pageEdge |
Examples
//Create new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new page to the document.
PdfPage page = document.Pages.Add();
//Create new instance for PDF artifact.
PdfArtifact artifact = new PdfArtifact();
//Set artifact type.
artifact.ArtifactType = PdfArtifactType.Layout;
//Set the attachement for the artifact.
artifact.Attached = new PdfAttached(PdfEdge.Left);
//Set bounding box for the artifact.
artifact.BoundingBox = new RectangleF(0, 0, 100, 100);
//Create new instance for the PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
//Set tag for the element.
element.PdfTag = artifact;
//Create new instance for the PDF font.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Create new instance for the PDF brush.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element on the PDF page.
element.Draw(page, new RectangleF(0, 0, page.Graphics.ClientSize.Width / 2, 200));
//Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Create new instance for PDF artifact.
Dim artifact As PdfArtifact = New PdfArtifact()
'Set artifact type.
artifact.ArtifactType = PdfArtifactType.Layout
'Set the attachement for the artifact.
artifact.Attached = New PdfAttached(PdfEdge.Left)
'Set the bounding box for the artifact.
artifact.BoundingBox = New RectangleF(0, 0, 100, 100)
'Create new instance for the PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
'Set tag for the element.
element.PdfTag = artifact
'Create new instance for the PDF font.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Create new instance for the PDF brush.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element on the PDF page.
element.Draw(page, New RectangleF(0, 0, page.Graphics.ClientSize.Width / 2, 200))
'Save and close the document.
document.Save("Output.pdf")
document.Close(True)
See Also
PdfAttached(PdfEdge, PdfEdge)
Initialize the PdfAttached
Declaration
public PdfAttached(PdfEdge edge1, PdfEdge edge2)
Parameters
Type | Name | Description |
---|---|---|
PdfEdge | edge1 | |
PdfEdge | edge2 |
Examples
//Create new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new page to the document.
PdfPage page = document.Pages.Add();
//Create new instance for PDF artifact.
PdfArtifact artifact = new PdfArtifact();
//Set artifact type.
artifact.ArtifactType = PdfArtifactType.Layout;
//Set the attachement for the artifact.
artifact.Attached = new PdfAttached(PdfEdge.Left, PdfEdge.Right);
//Set bounding box for the artifact.
artifact.BoundingBox = new RectangleF(0, 0, 100, 100);
//Create new instance for the PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
//Set tag for the element.
element.PdfTag = artifact;
//Create new instance for the PDF font.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Create new instance for the PDF brush.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element on the PDF page.
element.Draw(page, new RectangleF(0, 0, page.Graphics.ClientSize.Width / 2, 200));
//Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Create new instance for PDF artifact.
Dim artifact As PdfArtifact = New PdfArtifact()
'Set artifact type.
artifact.ArtifactType = PdfArtifactType.Layout
'Set the attachement for the artifact.
artifact.Attached = New PdfAttached(PdfEdge.Left, PdfEdge.Right)
'Set the bounding box for the artifact.
artifact.BoundingBox = New RectangleF(0, 0, 100, 100)
'Create new instance for the PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
'Set tag for the element.
element.PdfTag = artifact
'Create new instance for the PDF font.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Create new instance for the PDF brush.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element on the PDF page.
element.Draw(page, New RectangleF(0, 0, page.Graphics.ClientSize.Width / 2, 200))
'Save and close the document.
document.Save("Output.pdf")
document.Close(True)
See Also
PdfAttached(PdfEdge, PdfEdge, PdfEdge, PdfEdge)
Initialize the PdfAttached
Declaration
public PdfAttached(PdfEdge edge1, PdfEdge edge2, PdfEdge edge3, PdfEdge edge4)
Parameters
Type | Name | Description |
---|---|---|
PdfEdge | edge1 | |
PdfEdge | edge2 | |
PdfEdge | edge3 | |
PdfEdge | edge4 |
Examples
//Create new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new page to the document.
PdfPage page = document.Pages.Add();
//Create new instance for PDF artifact.
PdfArtifact artifact = new PdfArtifact();
//Set artifact type.
artifact.ArtifactType = PdfArtifactType.Layout;
//Set the attachement for the artifact.
artifact.Attached = new PdfAttached(PdfEdge.Left, PdfEdge.Right, PdfEdge.Top, PdfEdge.Bottom);
//Set bounding box for the artifact.
artifact.BoundingBox = new RectangleF(0, 0, 100, 100);
//Create new instance for the PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
//Set tag for the element.
element.PdfTag = artifact;
//Create new instance for the PDF font.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Create new instance for the PDF brush.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element on the PDF page.
element.Draw(page, new RectangleF(0, 0, page.Graphics.ClientSize.Width / 2, 200));
//Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Create new instance for PDF artifact.
Dim artifact As PdfArtifact = New PdfArtifact()
'Set artifact type.
artifact.ArtifactType = PdfArtifactType.Layout
'Set the attachement for the artifact.
artifact.Attached = New PdfAttached(PdfEdge.Left, PdfEdge.Right, PdfEdge.Top, PdfEdge.Bottom)
'Set the bounding box for the artifact.
artifact.BoundingBox = New RectangleF(0, 0, 100, 100)
'Create new instance for the PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
'Set tag for the element.
element.PdfTag = artifact
'Create new instance for the PDF font.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Create new instance for the PDF brush.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element on the PDF page.
element.Draw(page, New RectangleF(0, 0, page.Graphics.ClientSize.Width / 2, 200))
'Save and close the document.
document.Save("Output.pdf")
document.Close(True)
See Also
Methods
SetEdge(PdfEdge[])
Set edges for the page
Declaration
public void SetEdge(PdfEdge[] edges)
Parameters
Type | Name | Description |
---|---|---|
PdfEdge[] | edges | the page edges |
Examples
//Create new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new page to the document.
PdfPage page = document.Pages.Add();
//Create new instance for PDF artifact.
PdfArtifact artifact = new PdfArtifact();
//Set the artifact type.
artifact.ArtifactType = PdfArtifactType.Layout;
PdfEdge[] edges = { PdfEdge.Right, PdfEdge.Top };
//Create new instance for the PDF attached.
PdfAttached attached = new PdfAttached(PdfEdge.Left);
attached.SetEdge(edges);
//Set the attachement for the artifact.
artifact.Attached = attached;
//Set bounding box for the artifact.
artifact.BoundingBox = new RectangleF(0, 0, 100, 100);
//Create new instance for the PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
//Set tag for the element.
element.PdfTag = artifact;
//Create new instance for the PDF font.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Create new instance for the PDF brush.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element on the PDF page.
element.Draw(page, new RectangleF(0, 0, page.Graphics.ClientSize.Width / 2, 200));
//Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Create new instance for PDF artifact.
Dim artifact As PdfArtifact = New PdfArtifact()
'Set artifact type.
artifact.ArtifactType = PdfArtifactType.Layout
Dim edges As PdfEdge() = {PdfEdge.Right, PdfEdge.Top}
'Create new instance for the PDF attached.
Dim attached As PdfAttached = New PdfAttached(PdfEdge.Left)
attached.SetEdge(edges)
'Set the attachement for the artifact.
artifact.Attached = attached
'Set the bounding box for the artifact.
artifact.BoundingBox = New RectangleF(0, 0, 100, 100)
'Create new instance for the PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
'Set tag for the element.
element.PdfTag = artifact
'Create new instance for the PDF font.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Create new instance for the PDF brush.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element on the PDF page.
element.Draw(page, New RectangleF(0, 0, page.Graphics.ClientSize.Width / 2, 200))
'Save and close the document.
document.Save("Output.pdf")
document.Close(True)