Example #1
0
 /**
  * Get Order PDF by number
  * @param  integer $no
  * @param  boolean $download [description]
  * @return mixed
  */
 public function pdf($no, $download = false)
 {
     $handle = $this->getHandle($no);
     $pdf = $this->client->Order_GetPdf(array('orderHandle' => $handle))->Order_GetPdfResult;
     if ($download) {
         header('Content-type: application/pdf');
         header('Content-Disposition: attachment; filename="' . $no . '.pdf"');
         echo $pdf;
         return true;
     }
     return $pdf;
 }