Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Jun 19, 2017 9:25 am

hi, i want to ask, how do i make a custom fill form for user to draw his/her signature using tablet or any e-pen like in acrobat reader sign with draw. what i find is fill form with digital signature using certificate
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

blueeyeswhite
 
Posts: 15
Joined: Mon Jun 19, 2017 9:03 am

Mon Jun 19, 2017 10:15 am

Hello,

Thanks for your inquiry.
I will investigate this issue and give you reply as soon as possible.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Tue Jun 20, 2017 7:08 am

Hi,

I am afraid our Spire.Pdf currently does not have a direct way that transmits the image object to fill the image into the signature field, but we will add it as new feature into our schedule. Once it is done, we will inform you.
Sorry for the inconvenience caused.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Tue Jun 20, 2017 7:33 am

please do ..
thanks for the confirmation.
n.B : iam using free edition ver

blueeyeswhite
 
Posts: 15
Joined: Mon Jun 19, 2017 9:03 am

Tue Jun 20, 2017 7:45 am

Dear Blueeyeswhite,

Thanks for your reply.
I have added this new feature into our schedule. When it is done, we will notify you ASAP.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Fri Jun 30, 2017 9:04 am

Hi Blueeyeswhite,

Thanks for your waiting.
The new feature has been done in the newest Spire.PDF Pack(Hot Fix) Version:3.9.189, welcome to download it and set the property(signature.ConfiguerGraphicImage) to configure the image source for digital signature. I enclosed sample code for your kind reference.
Code: Select all
PdfDocument pdfdoc = new PdfDocument();
pdfdoc.LoadFromFile("SignField.pdf");
FileStream fs = File.OpenRead("Signature.gif");
PdfImage image = PdfImage.FromStream(fs);
PdfFormWidget form = pdfdoc.Form as PdfFormWidget;
PdfSignatureFieldWidget field = form.FieldsWidget[0] as PdfSignatureFieldWidget;
PdfCertificate cert = new PdfCertificate("SpireTestCert.pfx", "test");
PdfSignature signature = new PdfSignature(pdfdoc, field.Page, cert, field.Name,field);
signature.ConfigGraphicType = ConfiguerGraphicType.Picture;
signature.ConfiguerGraphicImage = image;
pdfdoc.SaveToFile("Result.pdf",FileFormat.PDF);

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Mon Jul 03, 2017 11:07 am

[*]DUPLICATE From BELOW
Last edited by blueeyeswhite on Mon Jul 03, 2017 11:11 am, edited 2 times in total.

blueeyeswhite
 
Posts: 15
Joined: Mon Jun 19, 2017 9:03 am

Mon Jul 03, 2017 11:08 am

thanks for the up feature. yet i haven't test it. but when i saw the code why still need to create pdfcertificate ?
and from the code, we still need to save a sign as image first and then attach it. and also i have read this tutorial
Code: Select all
https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/PDF-Security/Create-Visible-Digital-Signature-in-PDF-with-C-Code.html
which i don't want it also

iam sorry for the confusion, but if we try on acrobat reader there's a feature call Fill and sign and in there click add signature http://imgur.com/DwMWgQO after that we can custom draw signature http://imgur.com/pxBPZKV after we draw we can place where we want http://imgur.com/ZaxrHW2

is there any upcoming feature like this ? or maybe just custom draw signature on the pdf itself and put the image via coordinate manually.
because from the code itself, still need to draw signature first on paint and then save it and place it as image (kinda complicated)

blueeyeswhite
 
Posts: 15
Joined: Mon Jun 19, 2017 9:03 am

Tue Jul 04, 2017 2:00 am

Dear Blueeyeswhite,

Thanks for your detailed information, but I am sorry that our product currently doesn't support custom drawing signature graphics.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Tue Jul 04, 2017 7:39 am

thanks for your information, but for confirmation will there be any update in near future for this problem ?
thanks

blueeyeswhite
 
Posts: 15
Joined: Mon Jun 19, 2017 9:03 am

Tue Jul 04, 2017 9:04 am

Hi blueeyeswhite,

Thanks for feedback.
I just got a message about your requirement from our dev team, sorry that the function is difficult to achieve and I am afraid it will not be completed in a short time. If the feature is supported in the future, we will notify you.
We apologize for this inconvenience.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Wed Jul 05, 2017 7:14 am

thanks for the information ! :D
please do :mrgreen:

blueeyeswhite
 
Posts: 15
Joined: Mon Jun 19, 2017 9:03 am

Thu Jan 07, 2021 11:31 am

Dear Blueeyeswhite,

Thanks for your patient waiting.
The new feature has been implemented, please download the release Spire.PDF Pack Version:7.1 from the following link and use the code below to have a try.
Website link:https://www.e-iceblue.com/Download/download-pdf-for-net-now.html
Nuget link: https://www.nuget.org/packages/Spire.PDF/7.1.0
Code: Select all
...
PdfSignature signature = new PdfSignature(doc, page, cert, "demo");
signature.ConfigureCustomGraphics(DrawGraphics);

 private void DrawGraphics(PdfCanvas g)
{
   PointF point1 = new PointF(10, 20);
   PointF point2 = new PointF(25, 50);
   PointF point3 = new PointF(60, 20);
   PointF[] pntArr = { point1, point2, point3 };
   PdfRGBColor color = new PdfRGBColor(Color.Red);
   g.DrawPolygon(new PdfPen(color), pntArr);
   g.DrawRectangle(new PdfPen(Color.Green), new RectangleF(70, 10, 20, 30));
   g.DrawLine(new PdfPen(Color.Blue), new PointF(120, 50), new PointF(95, 5));
   g.DrawLine(new PdfPen(Color.Blue), new PointF(100, 30), new PointF(130, 20));
 }

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Tue Jan 12, 2021 6:01 am

Hi,

Greetings from E-iceblue!
Did you try the new method?
Any feedback will be greatly appreciated.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.PDF