title: PDFs generated using itextsharp giving error at the time of first print command
body: <p>I am getting below for the first time giving print command.</p>
  
  <p>"An error exists on this page. Acrobat may not display the page correctly. please 
  contact the person who created the pdf document to correct the problem".</p>
  
  <p>Print out is comming very fine. and Second time print out command not giving any error.</p>
  
  <p>Please help me why this error is comming for the first time print.</p>
  
  <p>This is part of my code to create PDF</p>
  
  <pre><code>PdfContentByte cb = writer.DirectContent;
  cb.BeginText();
  Font NormalFont = FontFactory.GetFont("Arial", 12, Font.NORMAL, Color.BLACK);
  // Add an image to a fixed position 
  iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(Server.MapPath("~/images/images/banner.tiff"));
  img.SetAbsolutePosition(35, 760);
  img.ScalePercent(50);
  cb.AddImage(img);
  // Draw a line by setting the line width and position
  cb.SetLineWidth(2);
  cb.MoveTo(20, 740);
  cb.LineTo(570, 740);
  cb.Stroke();
  //Header Details
  cb.BeginText();
  writeText(cb, drHead["EmpName"].ToString(), 25, 745, f_cb, 14);
  writeText(cb, "Employee ID:", 450, 745, f_cn, 12);
  writeText(cb, drHead["EmployeeID"].ToString(), 515, 745, f_cb, 12);
  cb.EndText();
  cb.BeginText();
  writeText(cb, "XXXX:", 25, 725, f_cb, 8);
  cb.EndText();
  cb.SetLineWidth(2);
  cb.MoveTo(20, 675);
  cb.LineTo(570, 675);
  cb.Stroke();
  cb.EndText();
  // Acknowledgement section
  cb.BeginText();
  writeText(cb, "XXXXXXXXXXXXXXXX", 20, 140, f_cb, 12);
  cb.EndText();
  cb.EndText();
  </code></pre>
  
  <p>Please help me to know what is the issue.</p>