从六进制二进制代码生成pdf,得到pdf输出得到错误

时间:2019-04-19 15:09:12

标签: php soap pdf-generation

Hexabinary pdf转换正常。它不显示pdf。

  

%PDF-1.5%����3 0 obj <>流

curl_setopt($soap_do, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=utf-8', 'Content-Length: '.strlen($partner_string) )); 

    $result = curl_exec($soap_do);        
    $p = xml_parser_create();
    xml_parse_into_struct($p, $result, $vals, $index);
    xml_parser_free($p);    

    $data ='';          
    if(isset($vals[5]['value']))    
    { 
      $data=$vals[5]['value'];  


    } 

   header("Content-type: application/pdf");
   header("Content-Disposition: inline; filename=filename.pdf");
   echo hex2bin($data);

0 个答案:

没有答案