Replace text in PDF file using iTextSharp(not Acro

2019-01-12 12:50发布

问题:

I am working on iTextSharp with asp.net C# to create PDF files. I created many reports(pdfs) using iTextSharp and all works well. Now my client gave me pre-formatted pdf file in which there are some text which need to be replaced with database values.

Now I want to replace text in existing pdf file and create new one. But as I googled, it is not possible in iTextSharp.

I have some questions now Is it really not possible to replace text in pdf using iTextSharp? Is there any other library or third party tool(free-no licence required) which does so? If so, please give me some suggestion on it.

For your info, I don't have AcroFields in pdf files and also heard about ASPOSE - PDF File format APIs (which is not free).

回答1:

NO you cannot replace the existing text with iText.

PDF is a display format, so when the PDF is rendered many decisions are made about page and character layout and positioning.PDF document is not a Word document as such.