function Image2PdfConvert() { if ($this->apiKey == "") { return "Please specify ApiKey"; } if ($this->outputPdfLocation == "") { return "Please specify Output pdf File Location"; } if ($this->inputImageLocation == "") { return "Please specify input Image Location"; } else { $fileStream = file_get_contents($this->inputImageLocation); } $parameters = array("FileByteStream" => $fileStream); $wsdl = "http://apis.pdfaid.com/pdfaidservices/Service1.svc?wsdl"; $endpoint = "http://apis.pdfaid.com/pdfaidservices/Service1.svc"; $option = array('trace' => 1); $client = new SoapClient($wsdl, $option); $headers[] = new SoapHeader('http://tempuri.org/', 'apikey', $this->apiKey); $headers[] = new SoapHeader('http://tempuri.org/', 'imageQuality', $this->imageQuality); $headers[] = new SoapHeader('http://tempuri.org/', 'pdfTitle', $this->pdfTitle); $headers[] = new SoapHeader('http://tempuri.org/', 'pdfAuthor', $this->pdfAuthor); $headers[] = new SoapHeader('http://tempuri.org/', 'pdfSubject', $this->pdfSubject); $headers[] = new SoapHeader('http://tempuri.org/', 'pdfKeywords', $this->pdfKeywords); $headers[] = new SoapHeader('http://tempuri.org/', 'responseResult', "test"); $client->__setSoapHeaders($headers); $result = $client->Image2Pdf($parameters); $clientResponse = $client->__getLastResponse(); if ($clientResponse == "APINOK") { return "API is not Valid"; } if ($clientResponse == "NOK") { return "Error Occured"; } else { $fp = fopen($this->outputPdfLocation, 'wb'); fwrite($fp, $result->FileByteStream); fclose($fp); return "OK"; } }