DynaPDF.OpenTag
---------------

Opens the specified tag so that contents can be written into it.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [13.2](newinversion132.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.OpenTag"; PDF; Tag { ; Lang; AltText; Expansion; BoxX1; BoxY1; BoxX2; BoxY2 } ) 

**MBS**( **"DynaPDF.OpenTag";** /\* Opens the specified tag so that contents can be written into it. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Tag**; /\* The tag name to open.  
Possible tags: Art, Artifact, Annot, BibEntry, BlockQuote, Caption, Code, Div, Document, Figure, Form, Formula, H, H1, H2, H3, H4, H5, H6, Index, Link, List, ListElem, ListText, Note, P, Part, Quote, Reference, Section, Span, Table, TableDataCell, TableHeader, TableRow, TOC, TOCEntry.e.g. "p" \*/   
**$Lang**; /\* Optional; RFC 3066 laguage identifier.e.g. "en-US" \*/   
**$AltText**; /\* Optional; Alternate text. \*/   
**$Expansion**; /\* Optional; Expansion of abbrevations or acronyms. \*/   
**$BoxX1**; /\* Optional; The top left x coordiante for the tag. \*/   
**$BoxY1**; /\* Optional; The top top y coordiante for the tag. \*/   
**$BoxX2**; /\* Optional; The top right x coordiante for the tag. \*/   
**$BoxY2**) /\* Optional; The top bottom y coordiante for the tag. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |  |
| Tag | The tag name to open.   Possible tags: Art, Artifact, Annot, BibEntry, BlockQuote, Caption, Code, Div, Document, Figure, Form, Formula, H, H1, H2, H3, H4, H5, H6, Index, Link, List, ListElem, ListText, Note, P, Part, Quote, Reference, Section, Span, Table, TableDataCell, TableHeader, TableRow, TOC, TOCEntry. | "p" |  |
| Lang | RFC 3066 laguage identifier. | "en-US" | Optional |
| AltText | Alternate text. |  | Optional |
| Expansion | Expansion of abbrevations or acronyms. |  | Optional |
| BoxX1 | The top left x coordiante for the tag. |  | Optional |
| BoxY1 | The top top y coordiante for the tag. |  | Optional |
| BoxX2 | The top right x coordiante for the tag. |  | Optional |
| BoxY2 | The top bottom y coordiante for the tag. |  | Optional |

### Result

Returns OK or error.

### Description

Opens the specified tag so that contents can be written into it.   
When the corresponding contents was drawn or output the tag must be closed with [DynaPDF.CloseTag](DynaPDFCloseTag.md). The supported tags have the same meaning as the corresponding HTML tags.   
  
Special tags:  
| Annot | An annotation must be inserted to finish the tag! |
|---|---|
| BibEntry | Bibliography entry |
| Form | A form field must be inserted to finish the tag! |
| Link | A link annotation must be inserted to finish the tag (using [DynaPDF.FileLink](DynaPDFFileLink.md), [DynaPDF.PageLink](DynaPDFPageLink.md), or [DynaPDF.WebLink](DynaPDFWebLink.md))! |
| List | List |
| ListElem | List element within a List |
| ListText | List Text within a List Element |

See also [OpenTag](https://www.monkeybreadsoftware.com/DynaPDF-Manual/OpenTag.shtml) function in DynaPDF manual.

### Examples

Put a P tag around some text:

 Set Variable \[ $r ; Value: MBS ("DynaPDF.OpenTag"; $pdf ; "p") \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.WriteText](DynaPDFWriteText.md)"; $pdf ; 100; $x ; "Some black text") \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.CloseTag](DynaPDFCloseTag.md)"; $pdf ) \]  
### See also

- [DynaPDF.CloseTag](DynaPDFCloseTag.md)
- [DynaPDF.FileLink](DynaPDFFileLink.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.OpenTagEx](DynaPDFOpenTagEx.md)
- [DynaPDF.PageLink](DynaPDFPageLink.md)
- [DynaPDF.WebLink](DynaPDFWebLink.md)
- [DynaPDF.WriteText](DynaPDFWriteText.md)

### Release notes

- **Version 13.3**
    - Added [DynaPDF.AddDPartNode](https://www.mbsplugins.eu/DynaPDFAddDPartNode.shtml), [DynaPDF.CreateDPartRoot](https://www.mbsplugins.eu/DynaPDFCreateDPartRoot.shtml), [DynaPDF.DeleteWatermark](https://www.mbsplugins.eu/DynaPDFDeleteWatermark.shtml), [DynaPDF.GetLastTextOffset](https://www.mbsplugins.eu/DynaPDFGetLastTextOffset.shtml), [DynaPDF.HaveDPartRoot](https://www.mbsplugins.eu/DynaPDFHaveDPartRoot.shtml), [DynaPDF.MarkTemplateAsWatermark](https://www.mbsplugins.eu/DynaPDFMarkTemplateAsWatermark.shtml) and [DynaPDF.OpenTagEx](https://www.mbsplugins.eu/DynaPDFOpenTagEx.shtml) functions.
- **Version 13.2**
    - Added [DynaPDF.OpenTag](https://www.mbsplugins.eu/DynaPDFOpenTag.shtml) and [DynaPDF.CloseTag](https://www.mbsplugins.eu/DynaPDFCloseTag.shtml) functions to add tags for a tagged PDFs.

### Example Databases

- [DynaPDF/Create Text as PDFA](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Create%20Text%20as%20PDFA.shtml#5ScriptAnchor_)

### Blog Entries

- [Create PDF/UA with DynaPDF in FileMaker](https://www.mbsplugins.de/archive/2026-05-27/Create_PDFUA_with_DynaPDF_in_F/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 13.3](https://www.mbsplugins.de/archive/2023-07-25/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 13.2](https://www.mbsplugins.de/archive/2023-05-17/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.2pr1](https://www.mbsplugins.de/archive/2023-04-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 10th March 2023 , last changed 10th March 2023

  
[DynaPDF.OpenPDFFromFile](DynaPDFOpenPDFFromFile.md) - [DynaPDF.OpenTagEx](DynaPDFOpenTagEx.md)

[HTML Version](DynaPDFOpenTag.shtml)