How to add digital signature with image to PDF files using Perl?

I am working on a script that adds digital signature to PDF files using Perl PDF::API2.

I am using Martin Schuette script from: https://mschuette.name/files/pdfsign.pl

my problem is that script add a hidden signature and I am trying to add an image that linked to the signature.

I tried to change that part in the code but with no luck:

# Annotation Widget, contd.
$sigannotdict->{Type}    = PDFName("Annot");
$sigannotdict->{Subtype} = PDFName("Widget");
$sigannotdict->{F}       = PDFNum(4);
$sigannotdict->{Parent}  = $sigformdict;
$sigannotdict->{Rect}    = PDF::API2::Basic::PDF::Literal->new("[0 0 0 0]");
$sigannotdict->{P}       = $pdf->openpage(1);
$sigannotdict->{H}       = PDFName("N");
$sigannotdict = $p->new_obj($sigannotdict);