Uploaded From CV. Swandhana Server

This commit is contained in:
Duidev Software House
2025-01-27 08:16:55 +07:00
commit 6b3be42361
15186 changed files with 2328862 additions and 0 deletions

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
<?php
namespace Elibyy\TCPDF\Facades;
use Illuminate\Support\Facades\Facade;
/**
* @method static \TCPDF AddPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false)
* @method static \TCPDF AddSpotColor($name, $c, $m, $y, $k)
* @method static \TCPDF AddSpotColorHtml($name, $c, $m, $y, $k)
* @method static \TCPDF AddTTFFont($fontfamily, $fontstyle, $filename, $subset = 'default', $enc = '', $embed = true)
* @method static \TCPDF SetTitle($title, $isUTF8 = false)
* @method static \TCPDF SetSubject($subject, $isUTF8 = false)
* @method static \TCPDF SetAuthor($author, $isUTF8 = false)
* @method static \TCPDF SetKeywords($keywords, $isUTF8 = false)
* @method static \TCPDF SetHeaderData($ln = '', $lw = 0, $ht = '', $hs = '', $tc = array(0, 0, 0), $lc = array(0, 0, 0))
* @method static \TCPDF SetCreator($creator, $isUTF8 = false)
* @method static \TCPDF writeHTML($html, $ln = true, $fill = false, $reseth = false, $cell = false, $align = '')
* @method static \TCPDF Write($h, $txt, $link = '')
* @method static \TCPDF Output($name = '', $dest = '')
* @method static \TCPDF reset()
* @method static \TCPDF SetAutoPageBreak($auto, $margin = 0)
* @method static \TCPDF SetMargins($left, $top, $right = -1, $keepmargins = false)
* @method static \TCPDF SetProtection($permissions = array(), $user_pass = '', $owner_pass = null, $mode = 0, $pubkeys = null)
* @method static \TCPDF SetPageOrientation($orientation)
* @method static \TCPDF SetPageFormat($format, $orientation = '')
* @method static \TCPDF SetImageScale($scale)
* @method static \TCPDF Cell($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = 0, $link = '')
* @method static \TCPDF MultiCell($w, $h, $txt, $border = 0, $align = 'J', $fill = false)
* @method static \TCPDF Ln($h = null)
*
*/
class TCPDF extends Facade
{
protected static function getFacadeAccessor(){return 'tcpdf';}
}
+53
View File
@@ -0,0 +1,53 @@
<?php
namespace Elibyy\TCPDF;
use Illuminate\Support\Facades\Config;
use setasign\Fpdi\TcpdfFpdi;
class FpdiTCPDFHelper extends TcpdfFpdi
{
protected $headerCallback;
protected $footerCallback;
public function Header()
{
if ($this->headerCallback != null && is_callable($this->headerCallback)) {
$cb = $this->headerCallback;
$cb($this);
} else {
if (Config::get('tcpdf.use_original_header')) {
parent::Header();
}
}
}
public function Footer()
{
if ($this->footerCallback != null && is_callable($this->footerCallback)) {
$cb = $this->footerCallback;
$cb($this);
} else {
if (Config::get('tcpdf.use_original_footer')) {
parent::Footer();
}
}
}
public function setHeaderCallback($callback)
{
$this->headerCallback = $callback;
}
public function setFooterCallback($callback)
{
$this->footerCallback = $callback;
}
public function disableTcpdfLink()
{
// disable tcpdf metalink *sigh*
$this->tcpdflink = false;
}
}
+95
View File
@@ -0,0 +1,95 @@
<?php
namespace Elibyy\TCPDF;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
/**
* Class ServiceProvider
* @version 1.0
* @package Elibyy\TCPDF
*/
class ServiceProvider extends LaravelServiceProvider
{
protected $constantsMap = [
'K_PATH_MAIN' => 'path_main',
'K_PATH_URL' => 'path_url',
'K_PATH_FONTS' => 'font_directory',
'K_PATH_IMAGES' => 'image_directory',
'PDF_HEADER_LOGO' => 'header_logo',
'PDF_HEADER_LOGO_WIDTH' => 'header_logo_width',
'K_PATH_CACHE' => 'path_cache',
'K_BLANK_IMAGE' => 'blank_image',
'PDF_PAGE_FORMAT' => 'page_format',
'PDF_PAGE_ORIENTATION' => 'page_orientation',
'PDF_CREATOR' => 'creator',
'PDF_AUTHOR' => 'author',
'PDF_HEADER_TITLE' => 'header_title',
'PDF_HEADER_STRING' => 'header_string',
'PDF_UNIT' => 'page_units',
'PDF_MARGIN_HEADER' => 'margin_header',
'PDF_MARGIN_FOOTER' => 'margin_footer',
'PDF_MARGIN_TOP' => 'margin_top',
'PDF_MARGIN_BOTTOM' => 'margin_bottom',
'PDF_MARGIN_LEFT' => 'margin_left',
'PDF_MARGIN_RIGHT' => 'margin_right',
'PDF_FONT_NAME_MAIN' => 'font_name_main',
'PDF_FONT_SIZE_MAIN' => 'font_size_main',
'PDF_FONT_NAME_DATA' => 'font_name_data',
'PDF_FONT_SIZE_DATA' => 'font_size_data',
'PDF_FONT_MONOSPACED' => 'foto_monospaced',
'PDF_IMAGE_SCALE_RATIO' => 'image_scale_ratio',
'HEAD_MAGNIFICATION' => 'head_magnification',
'K_CELL_HEIGHT_RATIO' => 'cell_height_ratio',
'K_TITLE_MAGNIFICATION' => 'title_magnification',
'K_SMALL_RATIO' => 'small_ratio',
'K_THAI_TOPCHARS' => 'thai_topchars',
'K_TCPDF_CALLS_IN_HTML' => 'tcpdf_calls_in_html',
'K_TCPDF_THROW_EXCEPTION_ERROR' => 'tcpdf_throw_exception',
'K_TIMEZONE' => 'timezone',
'K_ALLOWED_TCPDF_TAGS' => 'allowed_tags',
];
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$configPath = dirname(__FILE__) . '/../config/tcpdf.php';
$this->mergeConfigFrom($configPath, 'tcpdf');
$this->app->singleton('tcpdf', function ($app) {
return new TCPDF($app);
});
}
public function boot()
{
if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
define('K_TCPDF_EXTERNAL_CONFIG', true);
}
foreach ($this->constantsMap as $key => $value) {
$value = Config::get('tcpdf.' . $value, null);
if (!is_null($value) && !defined($key)) {
if (is_string($value) && strlen($value) == 0) {
continue;
}
define($key, $value);
}
}
$configPath = dirname(__FILE__) . '/../config/tcpdf.php';
if (function_exists('config_path')) {
$targetPath = config_path('tcpdf.php');
} else {
$targetPath = app()->basePath() . '/config/tcpdf.php';
}
$this->publishes(array($configPath => $targetPath), 'config');
}
public function provides()
{
return ['pdf'];
}
}
+60
View File
@@ -0,0 +1,60 @@
<?php
namespace Elibyy\TCPDF;
use Illuminate\Support\Facades\Config;
class TCPDF
{
protected static $format;
protected $app;
/** @var TCPDFHelper */
protected $tcpdf;
public function __construct($app)
{
$this->app = $app;
$this->reset();
}
public function reset()
{
$class = Config::get('tcpdf.use_fpdi') ? FpdiTCPDFHelper::class : TCPDFHelper::class;
$this->tcpdf = new $class(
Config::get('tcpdf.page_orientation', 'P'),
Config::get('tcpdf.page_units', 'mm'),
static::$format ? static::$format : Config::get('tcpdf.page_format', 'A4'),
Config::get('tcpdf.unicode', true),
Config::get('tcpdf.encoding', 'UTF-8'),
false, // Diskcache is deprecated
Config::get('tcpdf.pdfa', false)
);
$this->tcpdf->disableTcpdfLink();
}
public static function changeFormat($format)
{
static::$format = $format;
}
public function __call($method, $args)
{
if (method_exists($this->tcpdf, $method)) {
return call_user_func_array([$this->tcpdf, $method], $args);
}
throw new \RuntimeException(sprintf('the method %s does not exists in TCPDF', $method));
}
public function setHeaderCallback($headerCallback)
{
$this->tcpdf->setHeaderCallback($headerCallback);
}
public function setFooterCallback($footerCallback)
{
$this->tcpdf->setFooterCallback($footerCallback);
}
}
+78
View File
@@ -0,0 +1,78 @@
<?php
namespace Elibyy\TCPDF;
use Illuminate\Support\Facades\Config;
class TCPDFHelper extends \TCPDF
{
protected $headerCallback;
protected $footerCallback;
public function Header()
{
if ($this->headerCallback != null && is_callable($this->headerCallback)) {
$cb = $this->headerCallback;
$cb($this);
} else {
if (Config::get('tcpdf.use_original_header')) {
parent::Header();
}
}
}
public function Footer()
{
if ($this->footerCallback != null && is_callable($this->footerCallback)) {
$cb = $this->footerCallback;
$cb($this);
} else {
if (Config::get('tcpdf.use_original_footer')) {
parent::Footer();
}
}
}
public function setHeaderCallback($callback)
{
$this->headerCallback = $callback;
}
public function setFooterCallback($callback)
{
$this->footerCallback = $callback;
}
public function addTOC($page = '', $numbersfont = '', $filler = '.', $toc_name = 'TOC', $style = '', $color = array(0, 0, 0))
{
// sort bookmarks before generating the TOC
parent::sortBookmarks();
parent::addTOC($page, $numbersfont, $filler, $toc_name, $style, $color);
}
public function addHTMLTOC($page = '', $toc_name = 'TOC', $templates = array(), $correct_align = true, $style = '', $color = array(0, 0, 0))
{
// sort bookmarks before generating the TOC
parent::sortBookmarks();
parent::addHTMLTOC($page, $toc_name, $templates, $correct_align, $style, $color);
}
public function checkPageBreak($h = 0, $y = null, $addpage = true)
{
parent::checkPageBreak($h, $y, $addpage);
}
public function getPageBreakTrigger()
{
return $this->PageBreakTrigger;
}
public function disableTcpdfLink()
{
// disable tcpdf metalink *sigh*
$this->tcpdflink = false;
}
}