diff --git a/sites/all/modules/fillpdf/fillpdf.module b/sites/all/modules/fillpdf/fillpdf.module
index 43108d6..848840e 100644
--- a/sites/all/modules/fillpdf/fillpdf.module
+++ b/sites/all/modules/fillpdf/fillpdf.module
@@ -305,6 +305,23 @@ function fillpdf_merge_pdf($fid, $nids = null, $webform_arr = null, $sample = nu
     }
   }
 
+  // Provide hook_fillpdf_merge_fields_alter() to let other modules
+  // alter fields before pdf generation.
+  $context = array(
+    'nodes' => $nodes,
+    'webforms' => $webforms,
+  );
+  
+  // drupal_alter can only take one argument as a reference
+  $data = array(
+    'fields' => $fields,
+    'image_data' => $image_data,  
+  );
+
+  drupal_alter('fillpdf_merge_fields_alter', $data, $context);
+  $fields = $data['fields'];
+  $image_data = $data['image_data']; 
+  
   $output_name = preg_replace('/[^a-zA-Z0-9_]/', '', $fillpdf_info->title) .'.pdf';
   $pdf_data = _fillpdf_get_file_contents($fillpdf_info->url, "<front>");
 
