diff --git a/views_pdf_template.php b/views_pdf_template.php
index 1a0f096..bd21214 100644
--- a/views_pdf_template.php
+++ b/views_pdf_template.php
@@ -473,7 +473,11 @@ class PdfTemplate extends FPDI {
     $fitcell = FALSE;
 
     // Run eval before
-    php_eval($options['render']['eval_before']);
+    if ($options['render']['eval_before'] != '') {
+      if (module_load_include('module', 'php')) {
+        php_eval($options['render']['eval_before']);
+      }
+    }
 
     // Add css if there is a css file set and stripHTML is not
     // active
@@ -503,8 +507,11 @@ class PdfTemplate extends FPDI {
     $this->SetFont($this->defaultFontFamily, implode('', $this->defaultFontStyle), $this->defaultFontSize);
 
     // Run eval after
-    php_eval($options['render']['eval_after']);
-
+    if ($options['render']['eval_after'] != '') {
+      if (module_load_include('module', 'php')) {
+        php_eval($options['render']['eval_after']);
+      }
+    }
 
     // Write Coordinates of element
     $this->elements[$key] = array(
