How to insert text in scanned PDF using asp.net
<p>I am using below code adding text in PDF file. But below code is not working for scanned PDF. Please help me if you have any idea.</p>

<pre><code>string oldFile = "C:\\PDF\\Memo1.pdf";
string newFile = "C:\\PDF\\MemoNew1.pdf";
PdfReader reader = new PdfReader(oldFile);
Rectangle size = reader.GetPageSizeWithRotation(1);
Document document = new Document(size);
FileStream fs = new FileStream(newFile, FileMode.Create, FileAccess.Write);
PdfWriter writer = PdfWriter.GetInstance(document, fs);
document.Open();
PdfContentByte cb = writer.DirectContent;
BaseFont bf = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
cb.SetColorFill(BaseColor.DARK_GRAY);
cb.SetFontAndSize(bf, 8);
cb.BeginText();
string text = "AAAAAAAAAAAAAA...";
cb.ShowTextAligned(1, text, 520, 640, 0);
cb.EndText();
cb.BeginText();
text = "ZZZZZZZZZZZZZZZZZZZZZ...";
cb.ShowTextAligned(2, text, 100, 200, 0);
cb.EndText();
PdfImportedPage page = writer.GetImportedPage(reader, 1);
cb.AddTemplate(page, 0, 0);
document.Close();
fs.Close();
writer.Close();
reader.Close();
</code></pre>