title: iText7- How to add a canvas object to table?
body: <p>Now I used pdfCanvas to graph a rectangle, code like below:
   PdfPage page = pdf.getFirstPage();</p>
  
  <pre><code>    PdfCanvas canvas = new PdfCanvas(page, true);
      float x = 35;
      float y = 480;
      canvas.rectangle(x, y, 30, 30).stroke();
  </code></pre>
  
  <p>In fact, I want to add the rectangle into a table</p>
  
  <pre><code> Table table = new Table(2);
      table.setWidth(261.5f);
  </code></pre>
  
  <p>iText 5, the canvas can be set to an image object and add to table. But in iText 7 the function doesn't work. How can i draw a picture to a table in iText7?</p>