huangcong

 

 

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");
        }

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-05-04
  • 2021-12-31
  • 2022-12-23
  • 2021-06-25
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-26
  • 2021-08-18
  • 2021-08-17
  • 2021-11-17
  • 2021-07-10
  • 2021-12-18
  • 2021-08-15
相关资源
相似解决方案