I'm trying to use the sample code to test the replace function:
Dim editor As PdfContentEditor = New PdfContentEditor()
editor.BindPdf(inputPath + "text.pdf")
editor.ReplaceText("Pdf", "WordPpt")
editor.Save(outputPath + "replace.pdf")
This will work, but then I cannot access the original file, text.pdf, from windows or nor can I run the script again as the file is locked. As though the process did not release it. To attemp to work around this I tried using a stream as the BindPdf argument with no success. I tried:
Dim inputStream As FileStream = File.Open(inputPath + inputFile, FileMode.Open, FileAccess.Read, FileShare.Read)
editor.BindPdf(inputStream)
I get an error trying this:
Exception Details: System.ArgumentNullException: Path cannot be null.
Parameter name: path
on this line: Line 32: editor.ReplaceText("Pdf", "WordPpt")
Can someone provide me with the correct way to handle this?
Thanks,
Ken