I tried to user your product and I have a problem.
I tried the following code to DigitalSign document and it says:
An unhandled exception of type 'System.NotSupportedException' occurred in mscorlib.dll
Additional information: Stream does not support reading.
Please help me what is problem?
Thank you
X509Certificate2 certificate = new X509Certificate2("JohnDoe.pfx", "johndoe");
// The name of the signature must be unique.
string signatureName = "SampleSignature";
// This is the Form XObject element that represents the contents of the signature field.
Telerik.Windows.Documents.Fixed.Model.Objects.Form form = new Telerik.Windows.Documents.Fixed.Model.Objects.Form();
form.FormSource = new FormSource();
form.FormSource.Size = new System.Windows.Size(120, 120);
// We will use the editor to fill the Form XObject.
FixedContentEditor formEditor = new FixedContentEditor(form.FormSource);
formEditor.DrawCircle(new System.Windows.Point(50, 50), 20);
formEditor.DrawText(signatureName);
// The Signature object is added to a signature field, so we can add a visualization to it.
SignatureField signatureField = new SignatureField(signatureName);
signatureField.Signature = new Signature(certificate);
// The widget contains the Form XObject and defines the appearance of the signature field.
SignatureWidget widget = signatureField.Widgets.AddWidget();
widget.Rect = new Rect(new System.Windows.Point(200, 600), new System.Windows.Size(100, 100));
widget.Border = new AnnotationBorder(10, AnnotationBorderStyle.Solid, null);
widget.Content.NormalContentSource = form.FormSource;
widget.RecalculateContent();
// The Widget class inherits from Annotation. And, as any other annotation, must be added to the respective collection of the page.
RadFixedDocument document = new RadFixedDocument();
RadFixedPage page = document.Pages.AddPage();
page.Annotations.Add(widget);
document.AcroForm.FormFields.Add(signatureField);
using (Stream stream = File.OpenWrite("signed.pdf"))
{
new PdfFormatProvider().Export(document, stream);
}
I tried the following code to DigitalSign document and it says:
An unhandled exception of type 'System.NotSupportedException' occurred in mscorlib.dll
Additional information: Stream does not support reading.
Please help me what is problem?
Thank you
X509Certificate2 certificate = new X509Certificate2("JohnDoe.pfx", "johndoe");
// The name of the signature must be unique.
string signatureName = "SampleSignature";
// This is the Form XObject element that represents the contents of the signature field.
Telerik.Windows.Documents.Fixed.Model.Objects.Form form = new Telerik.Windows.Documents.Fixed.Model.Objects.Form();
form.FormSource = new FormSource();
form.FormSource.Size = new System.Windows.Size(120, 120);
// We will use the editor to fill the Form XObject.
FixedContentEditor formEditor = new FixedContentEditor(form.FormSource);
formEditor.DrawCircle(new System.Windows.Point(50, 50), 20);
formEditor.DrawText(signatureName);
// The Signature object is added to a signature field, so we can add a visualization to it.
SignatureField signatureField = new SignatureField(signatureName);
signatureField.Signature = new Signature(certificate);
// The widget contains the Form XObject and defines the appearance of the signature field.
SignatureWidget widget = signatureField.Widgets.AddWidget();
widget.Rect = new Rect(new System.Windows.Point(200, 600), new System.Windows.Size(100, 100));
widget.Border = new AnnotationBorder(10, AnnotationBorderStyle.Solid, null);
widget.Content.NormalContentSource = form.FormSource;
widget.RecalculateContent();
// The Widget class inherits from Annotation. And, as any other annotation, must be added to the respective collection of the page.
RadFixedDocument document = new RadFixedDocument();
RadFixedPage page = document.Pages.AddPage();
page.Annotations.Add(widget);
document.AcroForm.FormFields.Add(signatureField);
using (Stream stream = File.OpenWrite("signed.pdf"))
{
new PdfFormatProvider().Export(document, stream);
}