You are here

function _fillpdf_get_file_contents in FillPDF 6

Same name and namespace in other branches
  1. 7.2 fillpdf.module \_fillpdf_get_file_contents()
  2. 7 fillpdf.module \_fillpdf_get_file_contents()
3 calls to _fillpdf_get_file_contents()
fillpdf_help in ./fillpdf.module
Implementation of hook_help().
fillpdf_merge_pdf in ./fillpdf.module
Constructs a page from scratch (pdf content-type) and sends it to the browser or saves it, depending on if a custom path is configured or not.
fillpdf_parse_pdf in ./fillpdf.module
This function generates the form fields from the specified PDF. It (1) sends a request to the iText servlet to parse the specified PDF, (2) iText returns an XML response with fields-mappings, this module parses the XML response & contsructs the…

File

./fillpdf.module, line 646
Allows mappings of PDFs to site content

Code

function _fillpdf_get_file_contents($filepath, $error_goto = null) {
  if ($error_goto && !file_exists($filepath)) {
    drupal_set_message("{$filepath} does not exist.  Check your\n      filesystem settings, as well as http://drupal.org/node/764936", 'error');
    drupal_goto($error_goto);
  }
  $handle = fopen($filepath, "r");
  $content = fread($handle, filesize($filepath));
  fclose($handle);
  return $content;
}