We use non-manage DLL that has a funciton to replace text in PDF document (http://www.debenu.com/docs/pdf_library_reference/ReplaceTag.php).
We are trying to move to managed solution (ITextSharp or PdfSharp).
I know that this question has been asked before and that the answers are "you should not do it" or "it is not easily supported by PDF".
However there exists a solution that works for us and we just need to convert it to C#.
Any ideas how I should approach it?
Replace string in PDF document (ITextSharp or PdfSharp)
itextsharppdfpdfsharp
Best Answer
According to your library reference link, you use the Debenu PDFLibrary function
ReplaceTag
. According to this Debenu knowledge base articleThat should be possible with any general purpose PDF library, it definitely is with iText(Sharp):
WARNING: Just like in case of the Debenu function, for most documents this code wouldn’t have any effect or would even be destructive. For some simple documents it might be able to replace content, but it really depends on how the PDF was constructed.
By the way, the Debenu knowledge base article continues:
Thus, if during your move to managed solution you also change the way the source documents are created, chances are that neither the Debenu PDFLibrary function
ReplaceTag
nor the code above will be able to change the content as desired.