text file contents on existing pdf

text file contents on existing pdf

Forum member · Jun 1, 2011
hi there, I have text file and pdf document, i need to get text file contents and paste it on to pdf document is it possible? thanks

Re: text file contents on existing pdf

Support · Jun 2, 2011
Hello, You can add text to the already existing PDF document without any problem using our DynamicPDF Merger for .NET product. You will need to read all the text from the text file and then add this text to the already existing PDF document by accessing the desired page using the index. Please find the below code for this. MergeDocument document = new MergeDocument(@"C:\Temp\Input.pdf"); Page page = document.Pages[0]; String str = File.ReadAllText(@"C:\Temp\Test.txt"); TextArea area = new TextArea(str, 0, 0, page.Dimensions.Width, page.Dimensions.Height); page.Elements.Add(area); document.Draw(@"C:\MyDocument.pdf"); Thanks, ceTe Software Support Team.