I have this piece of code that was supposed to insert a text after an image in a pdf.
// Read the data from input file
string reader = "C:\\InesProjetos\\PrintTextWithImage\\PrintTextWithImage\\cat.pdf";
string dest = "C:\\demo.pdf";
string text = "C:\\InesProjetos\\PrintTextWithImage\\PrintTextWithImage\\text.txt";
StreamReader rdr = new StreamReader(text);
// Must have write permissions
//to the path folder
PdfWriter writer = new PdfWriter(dest);
PdfReader readerFile = new PdfReader(reader);
PdfDocument pdf = new PdfDocument(writer);
Document document = new Document(pdf);
document.Add(new Paragraph(rdr.ReadToEnd()));
document.Close();
How do insert the text in text.txt file in cat.pdf file without overwriting the image that is in cat.pdf?
UPDATE
What to do with the readerFile object? Should I insert cat.pdf into demo.pdf and then add the text? And if so how?