| 158 |
} |
} |
| 159 |
|
|
| 160 |
$form_name = "webform_{$nid}"; |
$form_name = "webform_{$nid}"; |
| 161 |
$pdf_file="$host/files/pdf_forms/$form_name.pdf"; |
$pdf_file="{$host}/files/pdf_forms/{$form_name}.pdf"; |
| 162 |
|
|
| 163 |
// get the XFDF file contents |
// get the XFDF file contents |
| 164 |
$xfdf=createXFDF($pdf_file,$text_fields); |
$xfdf=createXFDF($pdf_file,$text_fields); |
| 165 |
|
|
|
//drupal_set_header('Content-type: application/vnd.adobe.xfdf'); |
|
|
//drupal_set_header('Content-Disposition: inline; filename="'.$content_type.'.xfdf"'); |
|
|
//echo $xfdf; |
|
|
|
|
|
|
|
| 166 |
$file_name="{$form_name}.xfdf"; |
$file_name="{$form_name}.xfdf"; |
| 167 |
file_save_data($xfdf, "pdf_forms/{$file_name}", FILE_EXISTS_REPLACE); |
file_save_data($xfdf, "pdf_forms/{$file_name}", FILE_EXISTS_REPLACE); |
| 168 |
|
|
| 169 |
$download_name=db_result(db_query("SELECT title FROM {node} WHERE nid=%d",$nid)); |
$download_name=db_result(db_query("SELECT title FROM {node} WHERE nid=%d",$nid)); |
| 170 |
$download_name= preg_replace('/[^a-zA-Z0-9_]/','',$download_name).'.pdf'; |
$download_name= preg_replace('/[^a-zA-Z0-9_]/','',$download_name).'.pdf'; |
| 171 |
|
|
| 172 |
header("Content-Type:application/pdf"); |
//header("Content-Type:application/pdf"); |
| 173 |
|
header('Content-type: application/vnd.adobe.xfdf'); |
| 174 |
header('Content-disposition: attachment; filename='.$download_name); |
header('Content-disposition: attachment; filename='.$download_name); |
| 175 |
readfile("http://ocdevel.com/cgi-bin/to_pdf.sh.cgi?form={$form_name}&host={$host}"); |
readfile("http://ocdevel.com/cgi-bin/to_pdf.sh.cgi?form={$form_name}&host={$host}"); |
| 176 |
|
|