Print Page | Close Window

add handwrite siganture to pdf form

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3811
Printed Date: 24 Apr 24 at 6:49AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: add handwrite siganture to pdf form
Posted By: mazluta
Subject: add handwrite siganture to pdf form
Date Posted: 05 May 20 at 11:01PM
is there away to add signature drawing possibility or image as hanwrite signature ?



Replies:
Posted By: Ingo
Date Posted: 06 May 20 at 10:32PM
Hi,

yes... with image.
Here's a normal sample from the kb:
https://www.debenu.com/kb/add-visual-digital-signature-to-a-pdf-programmatically/
Here you'll find all related functions:
https://www.debenu.com/docs/pdf_library_reference/SecurityAndSignatures.php

Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo



Posted By: mazluta
Date Posted: 07 May 20 at 9:18PM
thanks.
i will check it.


Posted By: mazluta
Date Posted: 07 May 20 at 9:24PM
what you suggest is to sign with pfx file

i just want to add "handwrite" signature (with the mouse) in a PDF form.
or just PDF (with no form).
some thing like annotation but when the user add the BMP or sign with the mouse,
save the file and not let any one touch the "signature"


Posted By: Ingo
Date Posted: 07 May 20 at 9:27PM
here you can search for anything which exists in the Debenu ressources:
https://www.debenu.com/docs/pdf_library_reference/Search.php



-------------
Cheers,
Ingo



Posted By: mazluta
Date Posted: 08 May 20 at 9:17AM
that seem working.

procedure TfrmDemo.Button1Click(Sender: TObject);
var
  SignProcessID: Integer;
  FldIndx : integer;
  ImgIndex : integer;
  Rslt : integer;
  tmpJpg : TJpegGraphic;
  Stream  : TMemoryStream;
begin

  if Not Assigned(ViewPrintQP) then
  begin
    ViewPrintQP := TDebenuPDFLibrary.Create;
    ViewPrintQP.UnlockKey(edtLicenseKey.Text);
  end;

  Rslt := ViewPrintQP.LoadFromFile('c:\aa\QuickPDF.pdf', '');
  if rslt <> 1 then
    beep;

(*
  Rslt := ViewPrintQP.AddStampAnnotationFromImage(50,50,50,50,'c:\aa\logo-2.jpg','mazluta','hanibaal',0,0,0,0);
  if rslt <> 1 then
    beep;
  Rslt := ViewPrintQP.SaveToFile('c:\aa\Quick2.pdf');
  if rslt <> 1 then
    beep;
*)

  FldIndx := ViewPrintQP.NewFormField('mazluta',6);

  ViewPrintQP.SetFormFieldBounds(FldIndx, 10, 400, 100, 100);
  ViewPrintQP.SetFormFieldHighlightMode(FldIndx, 2);

  tmpJpg := TJpegGraphic.Create;
  Try
    tmpJpg.LoadFromFile('c:\aa\logo-2.jpg');
    Stream  := TMemoryStream.Create;
    Try
      tmpJpg.SaveToStream(Stream);
      ImgIndex := ViewPrintQP.AddImageFromStream(Stream,0);
    Finally
      FreeAndNil(Stream);
    End;
  Finally
    FreeAndNil(tmpJpg);
  End;

  Rslt := ViewPrintQP.SelectImage(ImgIndex);
  if rslt <> 1 then
    beep;

  Rslt := ViewPrintQP.SetFormFieldSignatureImage(FldIndx,ImgIndex,0);
  if rslt <> 1 then
    beep;

  ViewPrintQP.SetNeedAppearances(0);
  ViewPrintQP.UpdateAndFlattenFormField(FldIndx);

  Rslt := ViewPrintQP.SaveToFile('c:\aa\Quick2.pdf');
  if rslt <> 1 then
    beep;
  ViewPrintQP.Free;
end;



Posted By: mazluta
Date Posted: 08 May 20 at 9:19AM
now i want to add transparent image (i want the signature graphic image to be transparent).
is it possible ?



Posted By: Ingo
Date Posted: 08 May 20 at 8:01PM
Try it ... then you'll know it.
Post the code if it works... then we'll know it, too ;-)



-------------
Cheers,
Ingo




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk