42 if (preg_match(
"/page-width\=\"([^\"]+)\"/", $content, $matches)) {
43 $pagewidth = $matches[1];
45 $pageheight =
"29.7cm";
46 if (preg_match(
"/page-height\=\"([^\"]+)\"/", $content, $matches)) {
47 $pageheight = $matches[1];
51 if (((strcmp($pageheight,
"29.7cm") === 0) || (strcmp($pageheight,
"297mm") === 0))
52 && ((strcmp($pagewidth,
"21cm") === 0) || (strcmp($pagewidth,
"210mm") === 0))) {
54 } elseif (((strcmp($pagewidth,
"29.7cm") === 0) || (strcmp($pagewidth,
"297mm") === 0))
55 && ((strcmp($pageheight,
"21cm") === 0) || (strcmp($pageheight,
"210mm") === 0))) {
56 $pagesize =
"a4landscape";
57 } elseif (((strcmp($pageheight,
"21cm") === 0) || (strcmp($pageheight,
"210mm") === 0))
58 && ((strcmp($pagewidth,
"14.8cm") === 0) || (strcmp($pagewidth,
"148mm") === 0))) {
60 } elseif (((strcmp($pagewidth,
"21cm") === 0) || (strcmp($pagewidth,
"210mm") === 0))
61 && ((strcmp($pageheight,
"14.8cm") === 0) || (strcmp($pageheight,
"148mm") === 0))) {
62 $pagesize =
"a5landscape";
63 } elseif (((strcmp($pageheight,
"11in") === 0))
64 && ((strcmp($pagewidth,
"8.5in") === 0))) {
66 } elseif (((strcmp($pagewidth,
"11in") === 0))
67 && ((strcmp($pageheight,
"8.5in") === 0))) {
68 $pagesize =
"letterlandscape";
75 if (preg_match(
"/fo:flow[^>]*margin\=\"([^\"]+)\"/", $content, $matches)) {
77 $marginbody = $matches[1];
78 if (preg_match_all(
"/([^\s]+)/", (
string) $marginbody, $matches)) {
79 $marginBody_top = $matches[1][0];
80 $marginBody_right = $matches[1][1];
81 $marginBody_bottom = $matches[1][2];
82 $marginBody_left = $matches[1][3];
84 } elseif (preg_match(
"/fo:region-body[^>]*margin\=\"([^\"]+)\"/", $content, $matches)) {
85 $marginbody = $matches[1];
86 if (preg_match_all(
"/([^\s]+)/", (
string) $marginbody, $matches)) {
87 $marginBody_top = $matches[1][0];
88 $marginBody_right = $matches[1][1];
89 $marginBody_bottom = $matches[1][2];
90 $marginBody_left = $matches[1][3];
94 $xsl = file_get_contents(__DIR__ .
'/../../xml/fo2xhtml.xsl');
95 if ($content !==
'' && (is_string($xsl) && $xsl !==
'')) {
101 $content = $this->xlstProcess->process($args, []);
104 $content = preg_replace(
"/<\?xml[^>]+?>/",
"", $content);
107 $content = str_replace([
" ",
" "],
"<br />", $content);
110 'pageformat' => $pagesize,
111 'pagewidth' => $pagewidth,
112 'pageheight' => $pageheight,
113 'margin_body_top' => $marginBody_top,
114 'margin_body_right' => $marginBody_right,
115 'margin_body_bottom' => $marginBody_bottom,
116 'margin_body_left' => $marginBody_left,
117 'certificate_text' => $content
final const DEFAULT_MARGIN_BODY_TOP
final const DEFAULT_MARGIN_BODY_RIGHT
final const DEFAULT_MARGIN_BODY_LEFT
final const DEFAULT_MARGIN_BODY_BOTTOM