Im Tring to add img to pdf and the img is run over the text
how can i add img in the top off the pdf with out run over the text?
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile(@"E:\testdoc\sample.pdf");
foreach (PdfPageBase page in pdf.Pages)
{
PdfImage image = PdfImage.FromFile(@"E:\downapp\pic\color.jpg");
//set image x coordinates
float x = 0;
//set image width
float width = image.Width;
//set image height
float height = image.Height;
//set image y coordinates
float y = page.FindAllText().Finds[0].Bounds.Y - height - 2;
//draw image
page.Canvas.DrawImage(image, x, y, width, height);
}
pdf.SaveToFile("AddImgTop.pdf", FileFormat.PDF);
pdf.Close();