Analyze SignResult result to check newly created signatures if needed.
Sign Pdf document with Text signature Annotation appearance
This example shows how to add Text signature to Pdf document with annotation look. See SignResult
using(Signaturesignature=newSignature("sample.pdf")){TextSignOptionsoptions=newTextSignOptions("John Smith"){// set signature positionLeft=100,Top=100,// set signature rectangleWidth=100,Height=30,// setup proper signature implementationSignatureImplementation=TextSignatureImplementation.Annotation,Appearance=newPdfTextAnnotationAppearance(){Border=newBorder(){Color=Color.Blue,DashStyle=DashStyle.Dash,Weight=2,},BorderEffect=PdfTextAnnotationBorderEffect.Cloudy,BorderEffectIntensity=2,HCornerRadius=10,// text content of an annotationContents="Sample",Subject="Sample subject",Title="Sample Title",},// set signature alignmentVerticalAlignment=Domain.VerticalAlignment.Bottom,HorizontalAlignment=Domain.HorizontalAlignment.Right,Margin=newPadding(){Bottom=20,Right=20},// set text color and FontForeColor=Color.Red,Font=newSignatureFont{Size=12,FamilyName="Comic Sans MS"},};// sign document to filesignature.Sign("signedAnnotation.pdf",options);}
Sign Pdf document with Text signature Sticker appearance
This example shows how to add Text signature to Pdf document with sticker look. See SignResult
using(Signaturesignature=newSignature(filePath)){TextSignOptionsoptions=newTextSignOptions("John Smith"){// set signature positionLeft=100,Top=100,// set signature rectangleWidth=100,Height=30,// setup proper signature implementationSignatureImplementation=TextSignatureImplementation.Sticker,Appearance=newPdfTextStickerAppearance(){// select sticker iconIcon=PdfTextStickerIcon.Star,// setup if popup annotation will be opened by defaultOpened=false,// text content of an annotationContents="Sample",Subject="Sample subject",Title="Sample Title"},// set signature alignmentVerticalAlignment=Domain.VerticalAlignment.Bottom,HorizontalAlignment=Domain.HorizontalAlignment.Right,Margin=newPadding(){Bottom=20,Right=20},// set text color and FontForeColor=Color.Red,Font=newSignatureFont{Size=12,FamilyName="Comic Sans MS"},};// sign document to filesignature.Sign(outputFilePath,options);}
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: