Closes a sequence of tags.

 

   

Syntax
 

[C#]
Tag Close(Tag tag)
Tag Close(params string[] types)

 

   

Params
 
Name Description
tag The tag to be closed.
types The types of tags to be closed in sequence
return The last tag closed.

 

   

Notes
 

Closes a sequence of tags.

Ensure the Doc.Page is set correctly when you close a tag. If you move to a new page and then close a tag you will end up with a tag that includes the page even though there may not be any tagged content on it.

 

   

Example
 

This example shows how to add tagged content to a document which is already tagged.

 

using var doc = new Doc(); doc.Read("../Rez/spacex_nasa_dragon.pdf"); doc.Font = doc.EmbedFont("Arial", LanguageType.Unicode, false, true, false); doc.TextStyle.Size = 18; doc.Rect.SetRect(0, 0, doc.MediaBox.Width, 100); doc.TextStyle.HPos = 0.5; doc.TextStyle.Bold = true; doc.Color.SetRgb(200, 00, 0); doc.Tag.Open("P", "Span"); doc.AddText("This is a NASA document\r\n"); doc.Tag.CloseOpen("Span"); doc.AddText("National Aeronautics and Space Administration"); doc.Tag.Close("Span", "P"); doc.Save("addtagstotaggeddoc.pdf");


addtagstotaggeddoc.pdf

Also see example code in: ABCpdf Tagged Text Example, XTagging Open Function, XTextStyle AutoTag Property.