39 if (preg_match(
"/page-width\=\"([^\"]+)\"/", $content, $matches)) {
40 $pagewidth = $matches[1];
42 $pageheight =
"29.7cm";
43 if (preg_match(
"/page-height\=\"([^\"]+)\"/", $content, $matches)) {
44 $pageheight = $matches[1];
48 if (((strcmp($pageheight,
"29.7cm") === 0) || (strcmp($pageheight,
"297mm") === 0))
49 && ((strcmp($pagewidth,
"21cm") === 0) || (strcmp($pagewidth,
"210mm") === 0))) {
51 } elseif (((strcmp($pagewidth,
"29.7cm") === 0) || (strcmp($pagewidth,
"297mm") === 0))
52 && ((strcmp($pageheight,
"21cm") === 0) || (strcmp($pageheight,
"210mm") === 0))) {
53 $pagesize =
"a4landscape";
54 } elseif (((strcmp($pageheight,
"21cm") === 0) || (strcmp($pageheight,
"210mm") === 0))
55 && ((strcmp($pagewidth,
"14.8cm") === 0) || (strcmp($pagewidth,
"148mm") === 0))) {
57 } elseif (((strcmp($pagewidth,
"21cm") === 0) || (strcmp($pagewidth,
"210mm") === 0))
58 && ((strcmp($pageheight,
"14.8cm") === 0) || (strcmp($pageheight,
"148mm") === 0))) {
59 $pagesize =
"a5landscape";
60 } elseif (((strcmp($pageheight,
"11in") === 0))
61 && ((strcmp($pagewidth,
"8.5in") === 0))) {
63 } elseif (((strcmp($pagewidth,
"11in") === 0))
64 && ((strcmp($pageheight,
"8.5in") === 0))) {
65 $pagesize =
"letterlandscape";
72 if (preg_match(
"/fo:flow[^>]*margin\=\"([^\"]+)\"/", $content, $matches)) {
74 $marginbody = $matches[1];
75 if (preg_match_all(
"/([^\s]+)/", $marginbody, $matches)) {
76 $marginBody_top = $matches[1][0];
77 $marginBody_right = $matches[1][1];
78 $marginBody_bottom = $matches[1][2];
79 $marginBody_left = $matches[1][3];
81 } elseif (preg_match(
"/fo:region-body[^>]*margin\=\"([^\"]+)\"/", $content, $matches)) {
82 $marginbody = $matches[1];
83 if (preg_match_all(
"/([^\s]+)/", $marginbody, $matches)) {
84 $marginBody_top = $matches[1][0];
85 $marginBody_right = $matches[1][1];
86 $marginBody_bottom = $matches[1][2];
87 $marginBody_left = $matches[1][3];
91 $xsl = file_get_contents(
"./Services/Certificate/xml/fo2xhtml.xsl");
92 if ($content !==
'' && (is_string($xsl) && $xsl !==
'')) {
98 $content = $this->xlstProcess->process($args, []);
101 $content = preg_replace(
"/<\?xml[^>]+?>/",
"", $content);
104 $content = str_replace([
" ",
" "],
"<br />", $content);
107 'pageformat' => $pagesize,
108 'pagewidth' => $pagewidth,
109 'pageheight' => $pageheight,
110 'margin_body_top' => $marginBody_top,
111 'margin_body_right' => $marginBody_right,
112 'margin_body_bottom' => $marginBody_bottom,
113 'margin_body_left' => $marginBody_left,
114 'certificate_text' => $content
const DEFAULT_MARGIN_BODY_TOP
const DEFAULT_MARGIN_BODY_LEFT
const DEFAULT_MARGIN_BODY_BOTTOM
const DEFAULT_MARGIN_BODY_RIGHT