# Extensions and Tags [back](./README.md) ## Html Tags All the existing tags are under the namespace `\Spipu\Html2Pdf\Tag`. A tag must implement the interface `\Spipu\Html2Pdf\Tag\TagInterface`. A tag can extends the abstract class `\Spipu\Html2Pdf\Tag\AbstractTag` to implement some generic methods. Here is a tag example that will do nothing: ```php ` html tag. Look at all the existing tags in the `/src/Tag` folder to see examples. ## Extensions In order to add your new tags to Html2Pdf, you must a extension. An extension must implement the interface `\Spipu\Html2Pdf\Extension\ExtensionInterface`. You must implement the `getTags` method that will return a list of tag objects. ```php tagDefinitions)) { $this->tagDefinitions = array( new \Example\Html2Pdf\Tag\Example(), new \Example\Html2Pdf\Tag\Other(), ); } return $this->tagDefinitions; } } ``` Then, you can add your extension to Html2Pdf with the following method: ```php $html2pdf->addExtension(new \Example\Html2Pdf\Extension\MyExtension()); ``` The following core extensions are automatically added to Html2pdf: * `\Spipu\Html2Pdf\Extension\Core\HtmlExtension` * `\Spipu\Html2Pdf\Extension\Core\SvgExtension` It contains all the native tags. ## Overriding If an extension has the same name that an already added extension, it will replace the first one. If tag has the same name that an already added tag throw an extension, it will replace the first one. [back](./README.md)