Click here to Skip to main content
15,171,993 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi ...

I have a rich text box which consist of a text document with images and text in it.

1 ) I need a program to edit some specified words in text and other should be read only.(other words wont be editable)
2 ) i need print option (or pdf) in which it automatically add signature to all the footer page and a specified place. at the end

Please help me out with a solution .



for printing(pdf) :-


Dim myDocument As New iTextSharp.text.Document(PageSize.A4.Rotate())
PdfWriter.GetInstance(myDocument, New FileStream("c:\agreement.pdf", FileMode.Create))
' step 3: Open the document now using
myDocument.Open()
Try ' step 4: Now add some contents to the document
myDocument.Add(New iTextSharp.text.Paragraph(Me.txtdata.Text))
lblmsgbox.Text = "Agreement have been exported to c:\agreement.pdf"
Catch de As DocumentException
lblmsgbox.Text = "Error Occured While Copying"
Catch ioe As IOException
lblmsgbox.Text = "Error Occured While Copying"
End Try
' step 5: Remember to close the documnet
myDocument.Close()

BUT I NEED TO ADD SIGNATURE TO THE END OF ALL PAGES.
Posted
Comments
nilesh sawardekar 16-Jul-14 2:51am
   
signature is in which form?
Sidharth R 16-Jul-14 3:45am
   
.gif format ...
i need footer in all pages ...

i have modified my code to this...
but footer gets overlapped and header is not visible to



Dim myDocument As New iTextSharp.text.Document(PageSize.A4.Rotate())
PdfWriter.GetInstance(myDocument, New FileStream("c:\agreement.pdf", FileMode.Create))
myDocument.Open()
Dim Headerpdf As Global.iTextSharp.text.Image = Global.iTextSharp.text.Image.GetInstance("C:\Users\Sidharth\Desktop\me.gif")
Headerpdf.ScaleToFit(90.0F, 200.0F)
Headerpdf.ScalePercent(24.5F)
Headerpdf.Alignment = Global.iTextSharp.text.Image.ALIGN_TOP
Headerpdf.SetAbsolutePosition(10.5, 0)

Dim Footerpdf As Global.iTextSharp.text.Image = Global.iTextSharp.text.Image.GetInstance("C:\Users\Sidharth\Desktop\me.gif")
Footerpdf.ScaleToFit(90.0F, 200.0F)
Footerpdf.ScalePercent(24.5F)
Footerpdf.Alignment = Global.iTextSharp.text.Image.ALIGN_BOTTOM
Footerpdf.SetAbsolutePosition(10.5, 0)
For i As Integer = 0 To 4 - 2
myDocument.Add(Headerpdf)
myDocument.Add(New iTextSharp.text.Paragraph(Me.txtdata.Text)) ''carries the text/data that has to be printed on the page.
myDocument.Add(Footerpdf)
Next

Dim addLogo As iTextSharp.text.Image
addLogo = iTextSharp.text.Image.GetInstance("C:\Users\Sidharth\Desktop\me.gif")
addLogo.ScaleToFit(128, 37)
addLogo.Alignment = iTextSharp.text.Image.ALIGN_LEFT
myDocument.Add(New iTextSharp.text.Paragraph(vbNewLine & vbNewLine & "yours Faithfully" & vbNewLine & " "))
myDocument.Add(addLogo)
myDocument.Add(New iTextSharp.text.Paragraph(vbNewLine & vbNewLine & "DNname" & vbNewLine & " "))
myDocument.Close()

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900