Class PdfStructureElement
Represents the structure element
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 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)
Scope
Gets or sets the scope value
Declaration
public ScopeType Scope { get; set; }
Property Value
Type | Description |
---|---|
ScopeType |
Examples
//Creates a new PDF document
PdfDocument pdfDocument = new PdfDocument();
pdfDocument.DocumentInformation.Title = "Table";
//Adds new page
PdfPage pdfPage = pdfDocument.Pages.Add();
//Initialize the new structure element with tag type table
PdfStructureElement element = new PdfStructureElement(PdfTagType.Table);
//Create a new PdfGrid
PdfGrid pdfGrid = new PdfGrid();
//Adding tag to PDF grid
pdfGrid.PdfTag = element;
//Add three columns
pdfGrid.Columns.Add(3);
//Add header
pdfGrid.Headers.Add(1);
PdfGridRow pdfGridHeader = pdfGrid.Headers[0];
pdfGridHeader.Style.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Bold);
pdfGridHeader.Style.TextBrush = PdfBrushes.Brown;
//Adding tag for each row with tag type TR
pdfGridHeader.PdfTag = new PdfStructureElement(PdfTagType.TableRow);
pdfGridHeader.Cells[0].Value = "Employee ID";
//Adding tag for header cell with tag type TH
pdfGridHeader.Cells[0].PdfTag = new PdfStructureElement(PdfTagType.TableHeader) { Scope = ScopeType.Both };
pdfGridHeader.Cells[1].Value = "Employee Name";
//Adding tag for header cell with tag type TH
pdfGridHeader.Cells[1].PdfTag = new PdfStructureElement(PdfTagType.TableHeader) { Scope = ScopeType.Row};
pdfGridHeader.Cells[2].Value = "Salary";
//Adding tag for header cell with tag type TH
pdfGridHeader.Cells[2].PdfTag = new PdfStructureElement(PdfTagType.TableHeader) { Scope = ScopeType.Column };
//Add rows.
PdfGridRow pdfGridRow = pdfGrid.Rows.Add();
pdfGridRow.PdfTag = new PdfStructureElement(PdfTagType.TableRow);
pdfGridRow.Cells[0].Value = "E01";
pdfGridRow.Cells[1].Value = "Clay";
pdfGridRow.Cells[2].Value = "$10,000";
//Adding tag for each cell with tag type TD
pdfGridRow.Cells[0].PdfTag = new PdfStructureElement(PdfTagType.TableDataCell);
pdfGridRow.Cells[1].PdfTag = new PdfStructureElement(PdfTagType.TableDataCell);
pdfGridRow.Cells[2].PdfTag = new PdfStructureElement(PdfTagType.TableDataCell);
//Draw the PdfGrid
pdfGrid.Draw(pdfPage, PointF.Empty);
//save the document and dispose it
pdfDocument.Save("Output.pdf");
//close the document
pdfDocument.Close(true);
'Creates a new PDF document
Dim pdfDocument As PdfDocument = New PdfDocument()
pdfDocument.DocumentInformation.Title = "Table"
'Adds new page
Dim pdfPage As PdfPage = pdfDocument.Pages.Add()
'Initialize the new structure element with tag type table
Dim element As PdfStructureElement = New PdfStructureElement(PdfTagType.Table)
'Create a new PdfGrid
Dim pdfGrid As PdfGrid = New PdfGrid()
'Adding tag to PDF grid
pdfGrid.PdfTag = element
'Add three columns
pdfGrid.Columns.Add(3)
'Add header.
pdfGrid.Headers.Add(1)
Dim pdfGridHeader As PdfGridRow = pdfGrid.Headers(0)
pdfGridHeader.Style.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Bold)
pdfGridHeader.Style.TextBrush = PdfBrushes.Brown
'Adding tag for each row with tag type TR
pdfGridHeader.PdfTag = New PdfStructureElement(PdfTagType.TableRow)
pdfGridHeader.Cells(0).Value = "Employee ID"
'Adding tag for header cell with tag type TH
pdfGridHeader.Cells(0).PdfTag = New PdfStructureElement(PdfTagType.TableHeader) With {.Scope = ScopeType.Row}
pdfGridHeader.Cells(1).Value = "Employee Name"
'Adding tag for header cell with tag type TH
pdfGridHeader.Cells(0).PdfTag = New PdfStructureElement(PdfTagType.TableHeader) With {.Scope = ScopeType.Column}
pdfGridHeader.Cells(2).Value = "Salary"
'Adding tag for header cell with tag type TH
pdfGridHeader.Cells(0).PdfTag = New PdfStructureElement(PdfTagType.TableHeader) With {.Scope = ScopeType.Both}
'Add rows.
Dim pdfGridRow As PdfGridRow = pdfGrid.Rows.Add()
pdfGridRow.PdfTag = New PdfStructureElement(PdfTagType.TableRow)
pdfGridRow.Cells(0).Value = "E01"
pdfGridRow.Cells(1).Value = "Clay"
pdfGridRow.Cells(2).Value = "$10,000"
'Adding tag for each cell with tag type TD
pdfGridRow.Cells(0).PdfTag = New PdfStructureElement(PdfTagType.TableDataCell)
pdfGridRow.Cells(1).PdfTag = New PdfStructureElement(PdfTagType.TableDataCell)
pdfGridRow.Cells(2).PdfTag = New PdfStructureElement(PdfTagType.TableDataCell)
'Draw the PdfGrid
pdfGrid.Draw(pdfPage, PointF.Empty)
'save the document and dispose it
pdfDocument.Save("Output.pdf")
pdfDocument.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)