Class PdfStructureElement
Represents the structure element
Namespace: Syncfusion.Pdf
Assembly: Syncfusion.Pdf.Portable.dll
Syntax
public class PdfStructureElement : PdfTag
Examples
//Create a new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new pdf page.
PdfPage page = document.Pages.Add();
//Initialize new instance of structure element with tag type heading.
PdfStructureElement header = new PdfStructureElement(PdfTagType.Heading);
//Initialize new instance of structure element with tag type HeadingLevel1.
PdfStructureElement header1 = new PdfStructureElement(PdfTagType.HeadingLevel1);
header1.Parent = header;
//Initialize new instance of structure element with tag type Paragraph.
PdfStructureElement structElement = new PdfStructureElement(PdfTagType.Paragraph);
structElement.Parent = header1;
//Create PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
element.PdfTag = structElement;
//Set font for text element.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Set brush for text element.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element into 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 a new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new pdf page.
Dim page As PdfPage = document.Pages.Add()
'Initialize new instance of structure element with tag type heading.
Dim header As PdfStructureElement = New PdfStructureElement(PdfTagType.Heading)
'Initialize new instance of structure element with tag type HeadingLevel1.
Dim header1 As PdfStructureElement = New PdfStructureElement(PdfTagType.HeadingLevel1)
header1.Parent = header
'Initialize new instance of structure element with tag type Paragraph.
Dim structElement As PdfStructureElement = New PdfStructureElement(PdfTagType.Paragraph)
structElement.Parent = header1
'Create PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
element.PdfTag = structElement
'Set font for text element.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Set brush for text element.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element into 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
PdfStructureElement()
Initialize the structure element
Declaration
public PdfStructureElement()
Examples
//Create a new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new pdf page.
PdfPage page = document.Pages.Add();
//Initialize new instance of structure element.
PdfStructureElement structElement = new PdfStructureElement();
//set the order for the structure element.
structElement.Order = 1;
//set the title for the structure element.
structElement.Title = "Example Text";
//set the abbrevation for the structure element.
structElement.Abbrevation = "TTT";
//set the actual text for the structure element.
structElement.ActualText = "Text";
//set the alternate text for the structure element.
structElement.AlternateText = "ELement Text";
//set the parent for the structure element.
structElement.Parent = new PdfStructureElement(PdfTagType.Heading);
//Create new PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
element.PdfTag = structElement;
//Set font for text element.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Set brush for text element.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element into 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 a new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new pdf page.
Dim page As PdfPage = document.Pages.Add()
'Initialize new instance of structure element.
Dim structElement As PdfStructureElement = New PdfStructureElement()
'set the order for the structure element.
structElement.Order = 1
'set the title for the structure element.
structElement.Title = "Example Text"
'set the abbrevation for the structure element.
structElement.Abbrevation = "TTT"
'set the actual text for the structure element.
structElement.ActualText = "Text"
'set the alternate text for the structure element.
structElement.AlternateText = "ELement Text"
'set the parent for the structure element.
structElement.Parent = New PdfStructureElement(PdfTagType.Heading)
'Create new PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
element.PdfTag = structElement
'Set font for text element.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Set brush for text element.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element into 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
PdfStructureElement(PdfTagType)
Initialize the Structure element
Declaration
public PdfStructureElement(PdfTagType tag)
Parameters
Type | Name | Description |
---|---|---|
PdfTagType | tag | tag type |
Examples
//Create a new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new pdf page.
PdfPage page = document.Pages.Add();
//Initialize new instance of structure element with tag type heading.
PdfStructureElement header = new PdfStructureElement(PdfTagType.Heading);
//Initialize new instance of structure element with tag type HeadingLevel1.
PdfStructureElement header1 = new PdfStructureElement(PdfTagType.HeadingLevel1);
header1.Parent = header;
//Initialize new instance of structure element with tag type Paragraph.
PdfStructureElement structElement = new PdfStructureElement(PdfTagType.Paragraph);
structElement.Parent = header1;
//Create PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
element.PdfTag = structElement;
//Set font for text element.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Set brush for text element.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element into 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 a new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new pdf page.
Dim page As PdfPage = document.Pages.Add()
'Initialize new instance of structure element with tag type heading.
Dim header As PdfStructureElement = New PdfStructureElement(PdfTagType.Heading)
'Initialize new instance of structure element with tag type HeadingLevel1.
Dim header1 As PdfStructureElement = New PdfStructureElement(PdfTagType.HeadingLevel1)
header1.Parent = header
'Initialize new instance of structure element with tag type Paragraph.
Dim structElement As PdfStructureElement = New PdfStructureElement(PdfTagType.Paragraph)
structElement.Parent = header1
'Create PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
element.PdfTag = structElement
'Set font for text element.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Set brush for text element.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element into 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)
Properties
Abbrevation
Gets or sets the abbrevation for the structure element.
Declaration
public string Abbrevation { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
//Create a new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new pdf page.
PdfPage page = document.Pages.Add();
//Initialize new instance of structure element.
PdfStructureElement structElement = new PdfStructureElement();
//set the order for the structure element.
structElement.Order = 1;
//set the title for the structure element.
structElement.Title = "Example Text";
//set the abbrevation for the structure element.
structElement.Abbrevation = "TTT";
//set the actual text for the structure element.
structElement.ActualText = "Text";
//set the alternate text for the structure element.
structElement.AlternateText = "ELement Text";
//set the parent for the structure element.
structElement.Parent = new PdfStructureElement(PdfTagType.Heading);
//Create new PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
element.PdfTag = structElement;
//Set font for text element.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Set brush for text element.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element into 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 a new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new pdf page.
Dim page As PdfPage = document.Pages.Add()
'Initialize new instance of structure element.
Dim structElement As PdfStructureElement = New PdfStructureElement()
'set the order for the structure element.
structElement.Order = 1
'set the title for the structure element.
structElement.Title = "Example Text"
'set the abbrevation for the structure element.
structElement.Abbrevation = "TTT"
'set the actual text for the structure element.
structElement.ActualText = "Text"
'set the alternate text for the structure element.
structElement.AlternateText = "ELement Text"
'set the parent for the structure element.
structElement.Parent = New PdfStructureElement(PdfTagType.Heading)
'Create new PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
element.PdfTag = structElement
'Set font for text element.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Set brush for text element.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element into 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
ActualText
Gets or sets the actual text for the structure element
Declaration
public string ActualText { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
//Create a new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new pdf page.
PdfPage page = document.Pages.Add();
//Initialize new instance of structure element.
PdfStructureElement structElement = new PdfStructureElement();
//set the order for the structure element.
structElement.Order = 1;
//set the title for the structure element.
structElement.Title = "Example Text";
//set the abbrevation for the structure element.
structElement.Abbrevation = "TTT";
//set the actual text for the structure element.
structElement.ActualText = "Text";
//set the alternate text for the structure element.
structElement.AlternateText = "ELement Text";
//set the parent for the structure element.
structElement.Parent = new PdfStructureElement(PdfTagType.Heading);
//Create new PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
element.PdfTag = structElement;
//Set font for text element.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Set brush for text element.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element into 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 a new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new pdf page.
Dim page As PdfPage = document.Pages.Add()
'Initialize new instance of structure element.
Dim structElement As PdfStructureElement = New PdfStructureElement()
'set the order for the structure element.
structElement.Order = 1
'set the title for the structure element.
structElement.Title = "Example Text"
'set the abbrevation for the structure element.
structElement.Abbrevation = "TTT"
'set the actual text for the structure element.
structElement.ActualText = "Text"
'set the alternate text for the structure element.
structElement.AlternateText = "ELement Text"
'set the parent for the structure element.
structElement.Parent = New PdfStructureElement(PdfTagType.Heading)
'Create new PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
element.PdfTag = structElement
'Set font for text element.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Set brush for text element.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element into 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
AlternateText
Gets or sets the alternate text for the structure element
Declaration
public string AlternateText { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
//Create a new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new pdf page.
PdfPage page = document.Pages.Add();
//Initialize new instance of structure element.
PdfStructureElement structElement = new PdfStructureElement();
//set the order for the structure element.
structElement.Order = 1;
//set the title for the structure element.
structElement.Title = "Example Text";
//set the abbrevation for the structure element.
structElement.Abbrevation = "TTT";
//set the actual text for the structure element.
structElement.ActualText = "Text";
//set the alternate text for the structure element.
structElement.AlternateText = "ELement Text";
//set the parent for the structure element.
structElement.Parent = new PdfStructureElement(PdfTagType.Heading);
//Create new PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
element.PdfTag = structElement;
//Set font for text element.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Set brush for text element.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element into 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 a new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new pdf page.
Dim page As PdfPage = document.Pages.Add()
'Initialize new instance of structure element.
Dim structElement As PdfStructureElement = New PdfStructureElement()
'set the order for the structure element.
structElement.Order = 1
'set the title for the structure element.
structElement.Title = "Example Text"
'set the abbrevation for the structure element.
structElement.Abbrevation = "TTT"
'set the actual text for the structure element.
structElement.ActualText = "Text"
'set the alternate text for the structure element.
structElement.AlternateText = "ELement Text"
'set the parent for the structure element.
structElement.Parent = New PdfStructureElement(PdfTagType.Heading)
'Create new PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
element.PdfTag = structElement
'Set font for text element.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Set brush for text element.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element into 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
Language
Gets or sets the language for all text in the structure element
Declaration
public string Language { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
//Create a new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new pdf page.
PdfPage page = document.Pages.Add();
//Initialize new instance of structure element.
PdfStructureElement structElement = new PdfStructureElement();
//set the order for the structure element.
structElement.Order = 1;
//set the title for the structure element.
structElement.Title = "Example Text";
//set the abbrevation for the structure element.
structElement.Abbrevation = "TTT";
//set the actual text for the structure element.
structElement.ActualText = "Text";
//set the language for the structure element
structElement.Language = "en-Us";
//set the alternate text for the structure element.
structElement.AlternateText = "ELement Text";
//set the parent for the structure element.
structElement.Parent = new PdfStructureElement(PdfTagType.Heading);
//Create new PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
element.PdfTag = structElement;
//Set font for text element.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Set brush for text element.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element into 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 a new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new pdf page.
Dim page As PdfPage = document.Pages.Add()
'Initialize new instance of structure element.
Dim structElement As PdfStructureElement = New PdfStructureElement()
'set the order for the structure element.
structElement.Order = 1
'set the title for the structure element.
structElement.Title = "Example Text"
'set the abbrevation for the structure element.
structElement.Abbrevation = "TTT"
'set the actual text for the structure element.
structElement.ActualText = "Text"
'set the language for the structure element.
structElement.Language = "en-Us";
'set the alternate text for the structure element.
structElement.AlternateText = "ELement Text"
'set the parent for the structure element.
structElement.Parent = New PdfStructureElement(PdfTagType.Heading)
'Create new PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
element.PdfTag = structElement
'Set font for text element.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Set brush for text element.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element into 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
Order
Gets or sets the logical reading order for the structure element
Declaration
public override int Order { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
Examples
//Create a new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new pdf page.
PdfPage page = document.Pages.Add();
//Initialize new instance of structure element.
PdfStructureElement structElement = new PdfStructureElement();
//set the order for the structure element.
structElement.Order = 1;
//set the title for the structure element.
structElement.Title = "Example Text";
//set the abbrevation for the structure element.
structElement.Abbrevation = "TTT";
//set the actual text for the structure element.
structElement.ActualText = "Text";
//set the alternate text for the structure element.
structElement.AlternateText = "ELement Text";
//set the parent for the structure element.
structElement.Parent = new PdfStructureElement(PdfTagType.Heading);
//Create new PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
element.PdfTag = structElement;
//Set font for text element.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Set brush for text element.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element into 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 a new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new pdf page.
Dim page As PdfPage = document.Pages.Add()
'Initialize new instance of structure element.
Dim structElement As PdfStructureElement = New PdfStructureElement()
'set the order for the structure element.
structElement.Order = 1
'set the title for the structure element.
structElement.Title = "Example Text"
'set the abbrevation for the structure element.
structElement.Abbrevation = "TTT"
'set the actual text for the structure element.
structElement.ActualText = "Text"
'set the alternate text for the structure element.
structElement.AlternateText = "ELement Text"
'set the parent for the structure element.
structElement.Parent = New PdfStructureElement(PdfTagType.Heading)
'Create new PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
element.PdfTag = structElement
'Set font for text element.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Set brush for text element.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element into 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
Parent
Gets or sets the parent for the element
Declaration
public PdfStructureElement Parent { get; set; }
Property Value
Type | Description |
---|---|
PdfStructureElement |
Examples
//Create a new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new pdf page.
PdfPage page = document.Pages.Add();
//Initialize new instance of structure element with tag type heading.
PdfStructureElement header = new PdfStructureElement(PdfTagType.Heading);
//Initialize new instance of structure element with tag type HeadingLevel1.
PdfStructureElement header1 = new PdfStructureElement(PdfTagType.HeadingLevel1);
header1.Parent = header;
//Initialize new instance of structure element with tag type Paragraph.
PdfStructureElement structElement = new PdfStructureElement(PdfTagType.Paragraph);
structElement.Parent = header1;
//Create PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
element.PdfTag = structElement;
//Set font for text element.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Set brush for text element.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element into 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 a new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new pdf page.
Dim page As PdfPage = document.Pages.Add()
'Initialize new instance of structure element with tag type heading.
Dim header As PdfStructureElement = New PdfStructureElement(PdfTagType.Heading)
'Initialize new instance of structure element with tag type HeadingLevel1.
Dim header1 As PdfStructureElement = New PdfStructureElement(PdfTagType.HeadingLevel1)
header1.Parent = header
'Initialize new instance of structure element with tag type Paragraph.
Dim structElement As PdfStructureElement = New PdfStructureElement(PdfTagType.Paragraph)
//Set parent for structure element.
structElement.Parent = header1
'Create PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
element.PdfTag = structElement
'Set font for text element.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Set brush for text element.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element into 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)
TagType
Gets or sets the tag type for the element
Declaration
public PdfTagType TagType { get; set; }
Property Value
Type | Description |
---|---|
PdfTagType |
Examples
//Create a new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new pdf page.
PdfPage page = document.Pages.Add();
//Initialize new instance of structure element.
PdfStructureElement structElement = new PdfStructureElement();
//Set the tag type.
structElement.TagType = PdfTagType.HeadingLevel1;
//set the parent for the structure element.
structElement.Parent = new PdfStructureElement(PdfTagType.Heading);
//Create new PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
element.PdfTag = structElement;
//Set font for text element.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Set brush for text element.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element into 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 a new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new pdf page.
Dim page As PdfPage = document.Pages.Add()
'Initialize new instance of structure element.
Dim structElement As PdfStructureElement = New PdfStructureElement()
'Set the tag type.
structElement.TagType = PdfTagType.HeadingLevel1;
'set the parent for the structure element.
structElement.Parent = New PdfStructureElement(PdfTagType.Heading)
'Create new PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
element.PdfTag = structElement
'Set font for text element.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Set brush for text element.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element into 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
Title
Gets or sets the title for the structure element
Declaration
public string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
//Create a new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new pdf page.
PdfPage page = document.Pages.Add();
//Initialize new instance of structure element.
PdfStructureElement structElement = new PdfStructureElement();
//set the order for the structure element.
structElement.Order = 1;
//set the title for the structure element.
structElement.Title = "Example Text";
//set the abbrevation for the structure element.
structElement.Abbrevation = "TTT";
//set the actual text for the structure element.
structElement.ActualText = "Text";
//set the alternate text for the structure element.
structElement.AlternateText = "ELement Text";
//set the parent for the structure element.
structElement.Parent = new PdfStructureElement(PdfTagType.Heading);
//Create new PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
element.PdfTag = structElement;
//Set font for text element.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Set brush for text element.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element into 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 a new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new pdf page.
Dim page As PdfPage = document.Pages.Add()
'Initialize new instance of structure element.
Dim structElement As PdfStructureElement = New PdfStructureElement()
'set the order for the structure element.
structElement.Order = 1
'set the title for the structure element.
structElement.Title = "Example Text"
'set the abbrevation for the structure element.
structElement.Abbrevation = "TTT"
'set the actual text for the structure element.
structElement.ActualText = "Text"
'set the alternate text for the structure element.
structElement.AlternateText = "ELement Text"
'set the parent for the structure element.
structElement.Parent = New PdfStructureElement(PdfTagType.Heading)
'Create new PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
element.PdfTag = structElement
'Set font for text element.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Set brush for text element.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element into 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)