title: ITextSharp adding direct content bar code change font color for paragraphs
body: <p>I'm creating an application in c# for generation of some pdf files with bar code in it.</p>
  
  <p>I'm using the memory stream and placing data to the table (one column) which I'll write to the pdf file at the end.
  Everything is working fine till I need to add bar code. For that I use direct content.</p>
  
  <pre>
  pdfWriter = PdfWriter.GetInstance(pdfToCreate, outputStream);
  PdfContentByte cb = new PdfContentByte(pdfWriter);
  
  iTextSharp.text.Image bc128 = code128.CreateImageWithBarcode(cb, null, null);
  </pre>
  
  <p>After I create bar code I add it to the table using:</p>
  
  <pre><code>tableout.AddCell(image128);
  </code></pre>
  
  <p>And then I have a problem. Rows from the table that I've created before are shown, but I don't see a text. If I comment line with bar code addition everything is OK.</p>
  
  <p>I've found one comment on forum:</p>
  
  <blockquote>
    <p>Yep. Foreground text color is defined by the Font for the high-level
    text layout code. When you start using a PdfContentByte directly, the
    font and color become separated, but not until then.</p>
  </blockquote>
  
  <p>How can I solve this?</p>
  
  <p>I know that I can use system drawning method but image with bar code is not so clear.</p>