2012-08-09 30 views
0

我有一個eZpdf運行的康乃馨,生成pdf證書然後被推送到瀏覽器下載。這些工作大約需要3次,但是每隔一段時間它就會生成pdf,向我顯示下載文件夾以保存文件,出現在我的下載管理器中,然後在最終失敗之前停頓。eZpdf pdf下載失敗2在3倍,相同的數據,相同的pdf,但下載檔案

我在想這可能是一個PHP內存問題或超時問題,但很奇怪,它會工作一次,因爲完全相同的一組數據,然後失敗。

這基本上是我有

set_time_limit(1800);   
$pdfPassword = 'asdasda'; 
    //choose bg image based on choice 
    switch($_POST['certificateType']){ 
     case 1: 
      $pdf = new backgroundPDF('a4', 'portrait', 'image', array('img' => BASEURL.'/common/pdf/images/uno.png')); 
     break; 
     case 2: 
      $pdf = new backgroundPDF('a4', 'portrait', 'image', array('img' => BASEURL.'/common/pdf/images/dos.png')); 
     break; 
     case 3: 
      $pdf = new backgroundPDF('a4', 'portrait', 'image', array('img' => BASEURL.'/common/pdf/images/tres.png')); 
     break; 
    } 
    $pdf->ezSetMargins(50,70,50,50); 


    $pdf->selectFont(BASEURL.'/common/pdf/fonts/Helvetica.afm'); 
    $pdf->setColor(0/255,0/255,0/255); 

    //build strings 
    $commDate = friendlyDateOnly($info['Commisioned_Date_DT']); 

    //get logo 
    if($supplier['logo'] != ''){ 
     $logo = BASEURL.'/uploads/logos/'.$supplier['logo']; 
    }else{ 
     $logo = BASEURL.'/uploads/logos/SSAIB.png'; 
    } 

      /* THIS IS FOR CERTIFICATE 1 */ 
      //certificate info 
      $pdf->addText(144,692,14,$info['Scope_CH']); 
      $pdf->addText(144,663,14,$info['Certificate_Number']); 

      //customer info 
      $pdf->addText(225,591,9,$info['Customer_Name']); 
      $pdf->addText(225,571,9,$info['Address_1_VC']); 
      $pdf->addText(225,559,9,$info['Address_2_VC']); 
      $pdf->addText(225,547,9,$info['Address_2a_VC']); 
      $pdf->addText(225,535,9,$info['Address_3_VC']); 
      $pdf->addText(225,516,9,$info['Telephone_Number_VC']); 
      $pdf->addText(225,493,9,$info['Installers_Reference_VC']); 
      $pdf->addText(225,472,9,$commDate); 
      //$pdf->ezText($address, 9, 225,527); 

      //system info 
      $pdf->addText(225,404,9,$info['Extended_Grade']); 
      $pdf->addText(225,383,9,$info['Extended_Notification_Option']); 
      if($info['Extended_ARC'] != ''){ 
       $pdf->addText(225,362,9,$info['Extended_ARC']); 
      } 
      $pdf->addText(225,339,9,$info['Installed_To_Standards_VC']); 

      //Installers info 
      $pdf->addText(215,300,10,$_SESSION['user']['Trading_Name_VC']); 
      $pdf->addText(215,285,9,$supplier['Address_1']); 
      $pdf->addText(215,273,9,$supplier['Address_2']); 
      $pdf->addText(215,261,9,$supplier['Town']); 
      $pdf->addText(215,249,9,$supplier['County']); 
      $pdf->addText(215,237,9,$supplier['Post_Code']); 
      $pdf->addText(215,223,9,"Tel: ".$supplier['Telephone']); 
      $pdf->addText(120,176,9,friendlyDateOnly($info['Issue_Date'])); 

      //add logo 
      if(strstr($logo, '.png')){ 
       $pdf->addPngFromFile($logo,430,740,90,90); 
      }else{ 
       $pdf->addJpegFromFile($logo,430,740,90,90); 
      } 

    $pdf->setEncryption('',$pdfPassword,array('print')); 

    #create the pdf and stream it to the page 
    $pdf->ezStream(); 

當下載最終超時,我得到了以下錯誤消息

/Users/matt/Downloads/saz3CwFa.pdf.part could not be saved, because the source file could not be read. 
+0

進行監控當您不使用下載管理器並簡單使用瀏覽器的下載機制時,它的行爲是否相同?下載經理 – DavChana 2012-08-09 08:58:11

+0

我的意思是瀏覽器下載系統,也嘗試過不同的瀏覽器 – 2012-08-09 09:20:41

回答

0

我有一個巨大的錯誤日誌,只是把它倒重啓服務器和似乎沒問題。將通過