title: How to display pdf blob in bootstrap modal with button
body: <p>I am a beginner in dev web
  I have a board with two columns (id, action(button))  and when I click on the view button I want it to show me the content of the first column in pdf which is my database.</p>
  
  <p>Kindly help.</p>
  
  <pre><code>`require 'Class-BD.php';
   $db = Base_D::connect();
   $r= "SELECT * FROM bon_commande where Num_Bc='".$_POST['numbc']."'";
   $res = $db-&gt;query($r);
   $row = $res-&gt;fetch();
   header("Content-type:application/pdf");
   echo base64_decode($row['Bon_Commande']);  `
  
   &lt;tr&gt;
               &lt;td&gt;&lt;?php echo $row['Num_Bc']; ?&gt;&lt;/td&gt;
  
               &lt;td  class="text-center"&gt;
                  &lt;button type="button" class="btn btn-xs btn-outline-info btn-rounded view"&gt;&lt;i class="fa fa-eye" style="font-size:14px;color:black"&gt;&lt;/i&gt;&lt;/button&gt;
                &lt;/td&gt;
  
  &lt;/tr&gt;
  
  
      &lt;script&gt;
    $(document).ready(function()
    {
      $('.view').on('click',function()
       {
  
          $('#boncommande').modal('show');
  
           $tr = $(this).closest('tr');
  
          var data = $tr.children("td").map(function()
              {
              return $(this).text();
              }).get();
  
           var numbc = data[0];
  
           $.ajax({
                   url: "Viewpdf.php",
                   type: "POST",
                   data :{numbc:numbc},
                   success:function(data)
                    {
  
                    }
             })
  
  
  
      });
  
    });
  
  &lt;/script&gt; 
  </code></pre>