从pdf重定向到php

I want to redirect pdf to php .. After insert its redirect to bill_pdf.php. There pdf file is downloading . After Download I want redirect back to view.php .

Thank you

<?php
     require('../includes/db.php');
     require_once('../html2pdf/html2pdf.class.php');
   $content = "
   <html>
    <head>
        <title>Bill Generation</title>
        <style>
table,th,td
{
border:1px solid black;
border-collapse:collapse;
}
</style>
    </head>
    <body style='margin:0 auto;width:1000px'>
    <div style='width:730px;padding-left:15px'><hr/></div>

        <p style='text-align: center;  font-size: 16px;'> RECEIPT</p>
<div style='width:730px;padding-left:15px'><hr/></div>

 <p style='float:left;margin-left: 30px;font-size: 16px;'>Date: 2/3/14</p> 
<p style='font-size: 16px;margin-left:480px;margin-top:-35px'>Receipt No: 1234 </p> 
<p style='margin-left: 550px; margin-top: 40px;  font-size: 16px;'>Authorized Signatory</p></body>
</html>";
     ob_clean();
    $html2pdf = new HTML2PDF('P','A4','fr');
    $html2pdf->WriteHTML($content);
    $r=$html2pdf->Output('Bill.pdf','D');

?>

add this line

if($r) {
    header('Location: http://www.example.com/');
}

if $r will return true redirect somewhere ..

Enjoy :)

add

if($r) {
  header('Location: view.php');
}

after

$r=$html2pdf->Output('Bill.pdf','D');

You could use the meta to avoid having header errors

$r=$html2pdf->Output('Bill.pdf','D');
if($r)
{
   echo '<META HTTP-EQUIV="Refresh" Content="0; URL=view.php">';
}
else
{
   echo '<META HTTP-EQUIV="Refresh" Content="0; URL=some_error_page.php">';
}