-
Notifications
You must be signed in to change notification settings - Fork 0
/
HtmlInput.php
86 lines (69 loc) · 2.23 KB
/
HtmlInput.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
namespace DynamicPDF\Api;
include_once __DIR__ . '/Input.php';
include_once __DIR__ . '/HtmlResource.php';
include_once __DIR__ . '/InputType.php';
include_once __DIR__ . '/UnitConverter.php';
/**
*
* Represents an html input.
*
*/
class HtmlInput extends ConverterInput
{
/**
*
* Initializes a new instance of the ImageInput class.
*
* @param string|HtmlResource $resource The Html string or the HtmlResource object to create HtmlInput.
* @param string $basePath The basepath option for the url.
* @param string $pageSize The page size of the output PDF.
* @param string $orientation The page orientation of the output PDF.
* @param float $margin The page margins of the output PDF.
*/
public function __construct($resource, string $basePath = null, ?string $pageSize = null, ?string $orientation = null, ?float $margin = null)
{
parent::__construct($resource, $pageSize, $orientation, $margin);
if ($basePath != null) {
$this->BasePath = $basePath;
}
}
public $_Type = InputType::Html;
/**
*
* Gets or sets the BasePath Option.
*
*/
public $BasePath;
public function GetJsonSerializeString()
{
$jsonArray = array();
$jsonArray["type"] = "html";
if ($this->ResourceName != null) {
$jsonArray['resourceName'] = $this->ResourceName;
}
if ($this->BasePath != null) {
$jsonArray['basePath'] = $this->BasePath;
}
if ($this->PageWidth != null) {
$jsonArray['pageWidth'] = $this->PageWidth;
}
if ($this->PageHeight != null) {
$jsonArray['pageHeight'] = $this->PageHeight;
}
if ($this->TopMargin != null) {
$jsonArray['topMargin'] = $this->TopMargin;
}
if ($this->BottomMargin != null) {
$jsonArray['bottomMargin'] = $this->BottomMargin;
}
if ($this->RightMargin != null) {
$jsonArray['rightMargin'] = $this->RightMargin;
}
if ($this->LeftMargin != null) {
$jsonArray['leftMargin'] = $this->LeftMargin;
}
$jsonArray['id'] = $this->Id;
return $jsonArray;
}
}