My requirement is
1. Want to insert a multi-line text in existing pdf.
2. If iam having more than 1 pdf, how it is possible to insert text in more than 1 pdf.
I have given my code, Here iam getting as single line text in pdf output even after adding vbnewline in coding. Not as multi-line,How is it possbile ?
and also about multi-page insert text. Kindly provide me a solution from below code
Public Function pdfwrite()
Dim newFile As String = "D:\Temp\new.pdf"
Dim oldfile as string = "D:\Temp\old.pdf"
Dim reader As New PdfReader(oldfile)
Dim size As Rectangle = reader.GetPageSizeWithRotation(1)
Dim Document As New Document(size)
Dim Fs As FileStream = New FileStream(newFile, FileMode.Create, FileAccess.Write)
Dim writer As PdfWriter = PdfWriter.GetInstance(Document, Fs)
Document.Open()
Dim cb As PdfContentByte = writer.DirectContent
Dim bf As BaseFont = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED)
cb.SetFontAndSize(bf, 8)
cb.BeginText()
stext = " Section:Similar • type :Feature • support:60000 • count:127 • " & vbNewLine & "Size:544.02" & vbNewLine & "ID:807"
cb.ShowTextAligned(1, stext, 320, 80, 0)
cb.EndText()
Dim page As PdfImportedPage = writer.GetImportedPage(reader, 1)
cb.AddTemplate(page, 0, 0)
Document.Close()
Fs.Close()
writer.Close()
reader.Close()
Return 0
End Function