delegate forΒ signatureΒ stream creation (see event handlerΒ CreateSignatureStream);
image preview format - PNG / JPG / BMP,
unique signature identifier.
Note
Stream that were created byΒ CreateSignatureStream delegate will be disposed automatically once after generation of preview image. If you need to implement custom image preview stream disposing you have to pass additional argumentΒ ReleaseSignatureStreamΒ to clean up resources.
publicstaticvoidGetPreview(){// create optionsQrCodeSignOptionssignOptions=newQrCodeSignOptions{EncodeType=QrCodeTypes.QR,// setup Data property with Address objectData=newGroupDocs.Signature.Domain.Extensions.Address(){Street="221B Baker Street",City="London",State="NW",ZIP="NW16XE",Country="England"},// set right bottom cornerHorizontalAlignment=HorizontalAlignment.Left,VerticalAlignment=VerticalAlignment.Center,Width=100,Height=100,Margin=newPadding(10)};// create signature preview options objectPreviewSignatureOptionspreviewOption=newPreviewSignatureOptions(signOptions,CreateSignatureStream,ReleaseSignatureStream){SignatureId=Guid.NewGuid().ToString(),PreviewFormat=PreviewSignatureOptions.PreviewFormats.JPEG,};// generate previewSignature.GenerateSignaturePreview(previewOption);}privatestaticStreamCreateSignatureStream(PreviewSignatureOptionspreviewOptions){SignOptionssignOptions=previewOptions.SignOptions;stringimageFilePath=$"signature-{previewOptions.SignatureId}-{previewOptions.SignOptions.GetType().Name}.jpg";returnnewFileStream(imageFilePath,FileMode.Create);}privatestaticvoidReleaseSignatureStream(PreviewSignatureOptionspreviewOptions,StreamsignatureStream){signatureStream.Dispose();Console.WriteLine($"Signature {previewOptions.SignatureId}-{previewOptions.SignOptions.GetType().Name} is ready for preview");}
Advanced Usage Topics
To learn more about document eSign features, please refer to theΒ advanced usage section.
More resources
GitHub Examples
You may easily run the code above and see the feature in action in ourΒ GitHub examples: