Initial commit
This commit is contained in:
44
html2pdf-master/src/Extension/AbstractExtension.php
Normal file
44
html2pdf-master/src/Extension/AbstractExtension.php
Normal 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();
|
||||
}
|
57
html2pdf-master/src/Extension/Core/HtmlExtension.php
Normal file
57
html2pdf-master/src/Extension/Core/HtmlExtension.php
Normal 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(),
|
||||
);
|
||||
}
|
||||
}
|
62
html2pdf-master/src/Extension/Core/SvgExtension.php
Normal file
62
html2pdf-master/src/Extension/Core/SvgExtension.php
Normal 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),
|
||||
);
|
||||
}
|
||||
}
|
30
html2pdf-master/src/Extension/ExtensionInterface.php
Normal file
30
html2pdf-master/src/Extension/ExtensionInterface.php
Normal 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();
|
||||
}
|
Reference in New Issue
Block a user