- Code: Select all
http://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Security/How-to-add-signature-field-to-PDF.html
for now, in my form iam making a freedraw canvas and then save it into an image, and then set the image to pdf to sign, which is i need to set the coordinate to put the image.
- Code: Select all
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim bmp As New Bitmap(PictureBox1.Width, PictureBox1.Height)
PictureBox1.DrawToBitmap(bmp, New Rectangle(0, 0, PictureBox1.Width, PictureBox1.Height))
bmp.Save("test.jpg", Imaging.ImageFormat.Jpeg)
Dim pdfdoc As New PdfDocument
pdfdoc.LoadFromFile("AAA.pdf")
Using fs As FileStream = File.OpenRead("test.jpg")
Dim pdfimg As PdfImage = PdfImage.FromStream(fs)
Dim pdfpage As PdfPageBase
pdfpage = pdfdoc.Pages(0)
pdfpage.Canvas.DrawImage(pdfimg, pdfpage.Canvas.ClientSize.Width - pdfimg.Width / 2, pdfpage.Canvas.ClientSize.Height - pdfimg.Height / 2, 187, 64)
pdfdoc.SaveToFile("Sample.pdf")
End Using
bmp.Dispose()
File.Delete("test.jpg")
System.Diagnostics.Process.Start("Sample.pdf")
End Sub
is there any component fill form to draw in the pdf ? or any alternative way to sign via tablet without saving the image and re-put the the image as signature
thankss