Hallo,
Ich muss PDF bearbeiten und dabei bestimmte Texte (diese sind immer gleich) ändern.
Ich habe mich schonmal versucht mit itextsharp.
In der ersten Msgbox findet man den gewünschten Wert "BL?" und dieser ist dann in der 2. Msgbox auch auf "999" geändert.
Aber die PDF bleibt unverändert, wie bekomm ich das jetzt auf die PDF?
Ich muss PDF bearbeiten und dabei bestimmte Texte (diese sind immer gleich) ändern.
Ich habe mich schonmal versucht mit itextsharp.
VB.NET-Quellcode
- Dim Pfad As String = "S:\Austausch\Fiedler\VB.net\Datenblatt\Test - Kopie.pdf"
- Using reader As PdfReader = New PdfReader(Pfad)
- Dim Text As StringBuilder = New StringBuilder()
- For i = 1 To reader.NumberOfPages
- Text.Append(PdfTextExtractor.GetTextFromPage(reader, i))
- MsgBox(Text.ToString)
- Text.Replace("BL?", "999")
- MsgBox(Text.ToString)
- Text.ToString()
- Next
- End Using
In der ersten Msgbox findet man den gewünschten Wert "BL?" und dieser ist dann in der 2. Msgbox auch auf "999" geändert.
Aber die PDF bleibt unverändert, wie bekomm ich das jetzt auf die PDF?