Jump to content

FDF - Open PDF Problem


savagenoob

Recommended Posts

I can create the file using the PDF template, but cant open the FDF file. When you open the FDF it actually opens the PDF template with the data filled it, and when I try to open this with the script it says it cannot find the file and I assume it is talking about the PDF template...

How do I modify this to open the PDF with the FDF data....

<?php
$data['date']=date('Y-m-d H:i:s');                        
require_once 'createFDF.php';                                    
$fdf_file=time().'.fdf';              
$fdf_dir=dirname(__FILE__).'/Forms'; 
$pdf_doc='/BrokerAgreement.pdf';           
$fdf_data=createFDF($pdf_doc,$data);             
if($fp=fopen($fdf_dir.'/'.$fdf_file,'w')){                
fwrite($fp,$fdf_data,strlen($fdf_data));                
echo $fdf_file,' written successfully.';
header("Content-Disposition: attachment; filename=$fdf_file");
Header("Content-type: application/pdf");
$fd = fopen($fdf_dir.'/'.$fdf_file , "r");
   fpassthru($fd);
   unlink($fdf_file);
?>

Link to comment
https://forums.phpfreaks.com/topic/144869-fdf-open-pdf-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.