array( "verify_peer"=>false, "verify_peer_name"=>false, ), ); $html = file_get_contents($url,false,stream_context_create($arrContextOptions)); require_once COMMPATH.'/third_party/TCPDF/tcpdf.php'; $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT,true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor("jmcx"); $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->SetMargins(PDF_MARGIN_LEFT, 5,PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->SetFont('stsongstdlight', '', 10); //设置中文显示 $pdf->AddPage(); $pdf->writeHTML($html, true, false, true, false, ''); $pdf->Output($path.$filename,'F'); } public function pdf2img(){ $pdf = 'http://liche-api-dev.xiaoyu.com/temp/pdf/car_fh.pdf'; $pdf2img_url = 'http://liche-api-dev.xiaoyu.com/jar/pdf2img'; $this->load->library('mycurl'); $url = $pdf2img_url.'?furl='.$pdf; $res = $this->mycurl->httpGet($url); var_dump($res); } public function save_img(){ $img = 'https://liche-api-dev.xiaoyu.com/pdf2img/2021-07-07/1889917037729102438059_0.png'; //if(!$_FILES['file']){ // echo '参数错误';exit; //} $this->load->library('receiver/sign_entity'); //$res = $this->sign_entity->merge($img,$_FILES['file'],1050,1550,300); //协议 $res = $this->sign_entity->test($img,$_FILES['file']=222,1050,1550,300); //协议 //$res = $this->sign_entity->test($img,$base64_img,1050,200,300); //整车 //$res = $this->sign_entity->test($img,$base64_img,1050,400,300); //确认单 //$res = $this->sign_entity->test($img,$base64_img,300,1400,'','',false); //车辆交接信息 echo $res; } }