Welcome Guest, Not a member yet? Register   Sign In
Pass PDF to User from Web Service
#3

[eluser]bernie145[/eluser]
Aken,

Thank you! That's exactly what I was looking for.

Working Code...
Code:
if ($response->HighestSeverity != 'FAILURE' && $response->HighestSeverity != 'ERROR')
            {
                $this->fedex_common->printSuccess($client, $response);
                $ship_label='application/labels/'.$transaction_id.'.pdf';
                $fp = fopen($ship_label, 'wb');  
                fwrite($fp, ($response->CompletedShipmentDetail->CompletedPackageDetails->Label->Parts->Image));
                fclose($fp);
                $this->DB_model->insert_tracking_number($transaction_id,$response->CompletedShipmentDetail->CompletedPackageDetails->TrackingIds->TrackingNumber);
                                
                //The PDF is created, now we need to send it to the user
                if (file_exists($ship_label)) {
                    header('Content-type: application/pdf');
                    header('Content-Disposition: attachment; filename="shipping label.pdf"');
                    readfile($ship_label);
                    exit;
                } else {
                    echo 'Error: No File at this location';
                }
            }


Messages In This Thread
Pass PDF to User from Web Service - by El Forum - 06-20-2011, 03:56 PM
Pass PDF to User from Web Service - by El Forum - 06-20-2011, 04:12 PM
Pass PDF to User from Web Service - by El Forum - 06-21-2011, 08:45 AM
Pass PDF to User from Web Service - by El Forum - 06-21-2011, 09:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB