title: ItextSharp font color issue in ver 5.5.4+
body: <p>I have some code that creates a red "stamp" using a red font color:</p>
  
  <pre><code>    string StampDate = DateTime.Now.ToString("MM/dd/yyyy");
      string FontPath = Server.MapPath("/assets/Fonts");
      string OrigFile = Server.MapPath("/test.pdf");
      const int OpacityPercent = 80;
      const float PDFPaidFontSize = 28;
      const float PDFCopyX = 170;
      const float PDFPaidX = 385;
      const float PDFY = 20;
      const float PDFDateXOffset = 7;
      const float PDFDateYOffset = 12;
      const float PDFDateFontSize = 10;
      const string PaidStampTxt = "PAID";
      const string CopyStampTxt = "COPY";
      const string ArialFilename = "arialbd.ttf";
      PdfStamper stamper = null;
      PdfReader reader = null;
      PdfReader.unethicalreading = true;
      MemoryStream streamPDF;
      try
      {
          reader = new PdfReader(OrigFile);
          streamPDF = new MemoryStream();
          stamper = new PdfStamper(reader, streamPDF);
          for (int i = 1; i &lt;= reader.NumberOfPages; i++)
          {
              PdfGState gstate = new PdfGState();
              gstate.FillOpacity = gstate.StrokeOpacity = OpacityPercent / 100F;
              PdfContentByte overContent = stamper.GetOverContent(i);
              overContent.SaveState();
              overContent.SetGState(gstate);
              overContent.SetColorFill(BaseColor.RED);
              overContent.BeginText();
              BaseFont font = BaseFont.CreateFont(BaseFont.TIMES_BOLD, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
              overContent.SetFontAndSize(font, PDFPaidFontSize);
              overContent.ShowTextAligned(PdfContentByte.ALIGN_LEFT, CopyStampTxt, PDFCopyX, PDFY, 0);
              overContent.ShowTextAligned(PdfContentByte.ALIGN_LEFT, PaidStampTxt, PDFPaidX, PDFY, 0);
              overContent.SetColorFill(BaseColor.BLACK);
              font = BaseFont.CreateFont(Path.Combine(FontPath, ArialFilename), BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
              overContent.SetFontAndSize(font, PDFDateFontSize);
              overContent.ShowTextAligned(PdfContentByte.ALIGN_LEFT, StampDate, PDFPaidX + PDFDateXOffset, PDFY - PDFDateYOffset, 0);
              overContent.EndText();
              overContent.RestoreState();
          }
      }
      finally
      {
          if (stamper != null)
          {
              stamper.Close();
          }
          if (reader != null)
          {
              reader.Close();
          }
      }
      byte[] pdf = streamPDF.ToArray();
      Response.Cache.SetCacheability(HttpCacheability.NoCache);
      Response.Buffer = false;
      Response.Clear();
      Response.ClearContent();
      Response.ClearHeaders();
      Response.Charset = string.Empty;
      Response.ContentType = "application/pdf";
      Response.AddHeader("content-length", pdf.Length.ToString());
      Response.AddHeader("Content-Disposition", "inline;filename=test.pdf;");
      Response.BinaryWrite(pdf);
      Response.Close();
  </code></pre>
  
  <p>The resulting pdf text has a gray color instead of red.
  When i reverted back to ver 5.5.3 it shows up as red again. I have tried 5.5.4 and 5.5.5 and they both appear to have the same issue.</p>
  
  <p>My question is: Is this a bug or do I need to change my code to something newer?</p>
  
  <p>Edit: This appears to only be an issue with certain pdf files. Changing the fonts and pdf file versions did not seem to have an effect.</p>
  
  <p>Comparing a pdf that does work and a pdf that does not work (neither i can share publicly) I noticed that the pdf that does NOT work is a tagged pdf, has fast web view enabled, and was produced by adobe pdf library. A pdf that DOES work is NOT a tagged pdf, does NOT have fast web view enabled, and was created by itextsharp.</p>
  
  <p>Since I cannot control what the source pdf files will be, I reverted to an earlier version of itextsharp that seems to work all the time.</p>