--- /Applications/MAMP/htdocs/drupal5/sites/all/modules/table_export/formats/export_pdf.module +++ export_pdf.module @@ -26,11 +26,13 @@ $filename = strlen($title) ? table_export_clean($title).'.pdf' : 'table-export.pdf' ; $data = table_export_format_table_simple($data); $full_width = variable_get('export_pdf_full_width', FALSE); + $image_path = variable_get('export_pdf_image', '') ? url(variable_get('export_pdf_image', ''), NULL, NULL, TRUE) : FALSE; // convert to format pdf if ($full_width) { $attributes['width'] = '100%'; } + $output .= !empty($image_path) ? "" : ''; $output .= theme('table_export_table', $data['header'], $data['rows'], $attributes, NULL, FALSE); $pdf = new HTML2FPDF(); @@ -50,6 +52,12 @@ '#description' => t('When TRUE the PDF table output will fill the entire document.'), '#default_value' => variable_get('export_pdf_full_width', FALSE), ); + $form['export_pdf_image'] = array( + '#type' => 'textfield', + '#title' => t('Image'), + '#description' => t('Enter the path of an image file to use as a header. This can either be a full URL including http:// or an internal Drupal path.'), + '#default_value' => variable_get('export_pdf_image', ''), + ); return $form; }