黄聪

论SEO对人类的重要性,请看我的博客:hcsem.com

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

 

 

function convert($type='pdf')
        {
            $filename=time();
            $url=$this->input->get("url");
            if($type=='pdf')
            {
                $filename="F:/upload/tmp/".$filename.".pdf";
                exec("F:/home/phptool/wkhtmltopdf-i386 $url $filename");
                header('Content-Type: application/pdf');
            }
            elseif($type=='image')
            {
                $filename="upload/tmp/".$filename.".jpg";
                exec("/home/phptool/wkhtmltoimage-i386 $url $filename");
                header('Content-Type: image/jpeg');
            }
            header('Pragma: public');
            header('Expires: 0');
            header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
            header('Content-Transfer-Encoding: binary');
            header('Content-Length: '.filesize($filename));
            readfile("$filename");
        }

 

posted on 2016-06-12 22:09  黄聪  阅读(3582)  评论(0编辑  收藏  举报