32 if (preg_match(
"/page-width\=\"([^\"]+)\"/", $content, $matches)) {
33 $pagewidth = $matches[1];
35 $pageheight =
"29.7cm";
36 if (preg_match(
"/page-height\=\"([^\"]+)\"/", $content, $matches)) {
37 $pageheight = $matches[1];
41 if (((strcmp($pageheight,
"29.7cm") == 0) || (strcmp($pageheight,
"297mm") == 0))
42 && ((strcmp($pagewidth,
"21cm") == 0) || (strcmp($pagewidth,
"210mm") == 0))) {
44 } elseif (((strcmp($pagewidth,
"29.7cm") == 0) || (strcmp($pagewidth,
"297mm") == 0))
45 && ((strcmp($pageheight,
"21cm") == 0) || (strcmp($pageheight,
"210mm") == 0))) {
46 $pagesize =
"a4landscape";
47 } elseif (((strcmp($pageheight,
"21cm") == 0) || (strcmp($pageheight,
"210mm") == 0))
48 && ((strcmp($pagewidth,
"14.8cm") == 0) || (strcmp($pagewidth,
"148mm") == 0))) {
50 } elseif (((strcmp($pagewidth,
"21cm") == 0) || (strcmp($pagewidth,
"210mm") == 0))
51 && ((strcmp($pageheight,
"14.8cm") == 0) || (strcmp($pageheight,
"148mm") == 0))) {
52 $pagesize =
"a5landscape";
53 } elseif (((strcmp($pageheight,
"11in") == 0))
54 && ((strcmp($pagewidth,
"8.5in") == 0))) {
56 } elseif (((strcmp($pagewidth,
"11in") == 0))
57 && ((strcmp($pageheight,
"8.5in") == 0))) {
58 $pagesize =
"letterlandscape";
65 if (preg_match(
"/fo:flow[^>]*margin\=\"([^\"]+)\"/", $content, $matches)) {
67 $marginbody = $matches[1];
68 if (preg_match_all(
"/([^\s]+)/", $marginbody, $matches)) {
69 $marginBody_top = $matches[1][0];
70 $marginBody_right = $matches[1][1];
71 $marginBody_bottom = $matches[1][2];
72 $marginBody_left = $matches[1][3];
74 } elseif (preg_match(
"/fo:region-body[^>]*margin\=\"([^\"]+)\"/", $content, $matches)) {
75 $marginbody = $matches[1];
76 if (preg_match_all(
"/([^\s]+)/", $marginbody, $matches)) {
77 $marginBody_top = $matches[1][0];
78 $marginBody_right = $matches[1][1];
79 $marginBody_bottom = $matches[1][2];
80 $marginBody_left = $matches[1][3];
84 $xsl = file_get_contents(
"./Services/Certificate/xml/fo2xhtml.xsl");
85 if ((strlen($content)) && (strlen($xsl))) {
91 $content = $this->xlstProcess->process($args, array());
94 $content = preg_replace(
"/<\?xml[^>]+?>/",
"", $content);
97 $content = str_replace(
" ",
"<br />", $content);
98 $content = str_replace(
" ",
"<br />", $content);
101 'pageformat' => $pagesize,
102 'pagewidth' => $pagewidth,
103 'pageheight' => $pageheight,
104 'margin_body_top' => $marginBody_top,
105 'margin_body_right' => $marginBody_right,
106 'margin_body_bottom' => $marginBody_bottom,
107 'margin_body_left' => $marginBody_left,
108 'certificate_text' => $content
const DEFAULT_MARGIN_BODY_TOP
const DEFAULT_MARGIN_BODY_LEFT
const DEFAULT_MARGIN_BODY_BOTTOM
const DEFAULT_MARGIN_BODY_RIGHT