I am using the demo version of PDF.Kit for .NET. I am having a problem ("Stream was not writable") when hitting ReplaceText the second time through this loop:
Dim db As New DBServices(s/c@d, True)
Dim ds As DataSet
Dim ed As New PdfContentEditor
Dim str As New MemoryStream
ed.BindPdf("c:\temp\w.pdf")
ds = db.GetDataSet("SELECT * FROM DOC_CUST_ADDR_VW WHERE KEYOID = 6244")
If Not IsNothing(ds) Then
For x As Int32 = 0 To ds.Tables(0).Columns.Count - 1
If ds.Tables(0).Columns(x).ColumnName.ToLower <> "keyoid" Then
ed.ReplaceText("<<" & ds.Tables(0).Columns(x).ColumnName & ">>", ds.Tables(0).Rows(0).Item(x))
End If
Next
End If
ed.Save("c:\temp\testnew.pdf")
Then I noticed that if I just called .BindPDF and then .Save immediately after I got some invalid PDF error due to something in the head section.
Can you take a look at the attached document and tell me if something is wrong with it? It was created from an RTF file using Adobe's FileMaker AddIn for Word. Also, is there any limitations to calling ReplaceText more than once on a file?
Thanks,
Chris Garland