Initial commit

This commit is contained in:
2022-11-21 09:47:28 +01:00
commit 76cec83d26
11652 changed files with 1980467 additions and 0 deletions

View File

@ -0,0 +1,44 @@
<?php
/**
* Html2Pdf Library
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf\Extension;
use Spipu\Html2Pdf\Tag\TagInterface;
/**
* Class AbstractExtension
*/
abstract class AbstractExtension implements ExtensionInterface
{
/**
* @var array
*/
protected $tagDefinitions = array();
/**
* {@inheritDoc}
*/
public function getTags()
{
if (empty($this->tagDefinitions)) {
$this->tagDefinitions = $this->initTags();
}
return $this->tagDefinitions;
}
/**
* Init the tags
*
* @return TagInterface[]
*/
abstract protected function initTags();
}

View File

@ -0,0 +1,57 @@
<?php
/**
* Html2Pdf Library
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf\Extension\Core;
use Spipu\Html2Pdf\Extension\AbstractExtension;
use Spipu\Html2Pdf\Tag\Html;
/**
* Class HtmlExtension
*/
class HtmlExtension extends AbstractExtension
{
/**
* {@inheritDoc}
*/
public function getName()
{
return 'core_html';
}
/**
* @inheritdoc
*/
protected function initTags()
{
return array(
new Html\Address(),
new Html\B(),
new Html\Big(),
new Html\Bookmark(),
new Html\Cite(),
new Html\Del(),
new Html\Em(),
new Html\Font(),
new Html\I(),
new Html\Ins(),
new Html\Label(),
new Html\S(),
new Html\Samp(),
new Html\Small(),
new Html\Span(),
new Html\Strong(),
new Html\Sub(),
new Html\Sup(),
new Html\U(),
);
}
}

View File

@ -0,0 +1,62 @@
<?php
/**
* Html2Pdf Library
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf\Extension\Core;
use Spipu\Html2Pdf\Extension\AbstractExtension;
use Spipu\Html2Pdf\SvgDrawer;
use Spipu\Html2Pdf\Tag\Svg;
/**
* Class SvgExtension
*/
class SvgExtension extends AbstractExtension
{
/**
* @var SvgDrawer
*/
private $svgDrawer;
/**
* SvgExtension constructor.
*
* @param SvgDrawer $svgDrawer
*/
public function __construct(SvgDrawer $svgDrawer)
{
$this->svgDrawer = $svgDrawer;
}
/**
* {@inheritDoc}
*/
public function getName()
{
return 'core_svg';
}
/**
* @inheritdoc
*/
protected function initTags()
{
return array(
new Svg\Circle($this->svgDrawer),
new Svg\Ellipse($this->svgDrawer),
new Svg\G($this->svgDrawer),
new Svg\Line($this->svgDrawer),
new Svg\Path($this->svgDrawer),
new Svg\Polygon($this->svgDrawer),
new Svg\Polyline($this->svgDrawer),
new Svg\Rect($this->svgDrawer),
);
}
}

View File

@ -0,0 +1,30 @@
<?php
/**
* Html2Pdf Library
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf\Extension;
/**
* Interface ExtensionInterface
*/
interface ExtensionInterface
{
/**
* Get the extension's name
*
* @return string
*/
public function getName();
/**
* @return array()
*/
public function getTags();
}