dougou6727 2012-08-09 08:51
浏览 55

eZpdf pdf下载失败2次3次,相同的数据,相同的pdf,但下载时停止

I have a carnation of eZpdf running that generates pdf certificates which then get pushed to the browser to download. These work around 1 in 3 times but every other time it builds the pdf, shows me the download box to save the file, appears in my download manager then just stalls before eventually failing.

I'm thinking it may be a php memory issue or timeout issue but very odd that it would work once for the exact same set of data then fail.

this is basically what I have

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();

When the download eventually times out I get the following error message

/Users/matt/Downloads/saz3CwFa.pdf.part could not be saved, because the source file could not be read.
  • 写回答

1条回答 默认 最新

  • douhan6738 2012-08-09 11:36
    关注

    I had a massive error log, just emptied that rebooted the server and seems ok. Will monitor it though

    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?