From 16d352d2c9e5a2a280475d37486ec5bd8635d264 Mon Sep 17 00:00:00 2001 From: KB Bot Date: Thu, 15 May 2025 06:48:04 +0000 Subject: [PATCH 1/3] Added new kb article create-pdf-with-empty-signature-field-radpdfprocessing --- ...-empty-signature-field-radpdfprocessing.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 knowledge-base/create-pdf-with-empty-signature-field-radpdfprocessing.md diff --git a/knowledge-base/create-pdf-with-empty-signature-field-radpdfprocessing.md b/knowledge-base/create-pdf-with-empty-signature-field-radpdfprocessing.md new file mode 100644 index 00000000..5bc7c562 --- /dev/null +++ b/knowledge-base/create-pdf-with-empty-signature-field-radpdfprocessing.md @@ -0,0 +1,72 @@ +--- +title: Creating a PDF Document with an Empty Signature Field Using RadPdfProcessing +description: Learn how to create a PDF document with an empty signature field using the PdfProcessing library in a Document Processing environment. +type: how-to +page_title: How to Add an Empty Signature Field to a PDF Document in RadPdfProcessing +slug: create-pdf-with-empty-signature-field-radpdfprocessing +tags: pdfprocessing, document, processing, pdf, signature, field, empty, unsigned +res_type: kb +ticketid: 1687482 +--- + +## Environment + +| Version | Product | Author | +| ---- | ---- | ---- | +| 2025.1.205| RadPdfProcessing |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)| + +## Description +Learn how to create a PDF document with an empty signature field, which allows signing the document in any PDF viewer. The document should only contain the empty signature field, and when opened in a viewer, it should provide the option to sign. + +## Solution + +To create a PDF document with an empty [signature field]({%slug radpdfprocessing-model-interactive-forms-form-fields-signaturefield%}) using [RadPdfProcessing]({%slug radpdfprocessing-overview%}), follow these steps: + +1. Create a new PDF document and add a page. +2. Define the rectangle area for the [signature field]({%slug radpdfprocessing-model-interactive-forms-form-fields-signaturefield%}). +3. Create a signature field with a unique name. +4. Add a [widget]({%slug radpdfprocessing-model-annotations-widgets%}) to the signature field and set its size and position. +5. Add the widget to the page's annotations. +6. Save the document to a file. + +Here is the complete code snippet: + +```csharp +// Create a new PDF document and a page +RadFixedDocument document = new RadFixedDocument(); +RadFixedPage page = document.Pages.AddPage(); + +// Define the rectangle for the signature field +Rect signatureRect = new Rect(50, 700, 200, 50); + +// Create the signature field (do not assign a certificate or signature) +SignatureField signatureField = document.AcroForm.FormFields.AddSignature("SignatureFieldUniqueName"); + +// Add a widget for the signature field and set its position and size +SignatureWidget signatureWidget = signatureField.Widgets.AddWidget(); +signatureWidget.Rect = signatureRect; + +// Add the widget to the page's annotations +page.Annotations.Add(signatureWidget); + +// Save the document +string filePath = "EmptySignatureWidget.pdf"; +File.Delete(filePath); +using (var output = new System.IO.FileStream(filePath, System.IO.FileMode.Create, System.IO.FileAccess.Write)) +{ + new PdfFormatProvider().Export(document, output, TimeSpan.FromSeconds(10)); +} + +// Open the PDF +Process.Start(new ProcessStartInfo() { FileName = filePath, UseShellExecute = true }); +``` + +### Notes +- The code creates an empty signature field without assigning a certificate or signature. +- The resulting PDF can be opened in any PDF viewer that supports signing, allowing the user to sign the document. + +## See Also + +- [Digital Signature]({%slug radpdfprocessing-features-digital-signature%}) +- [Signature Field]({%slug radpdfprocessing-model-interactive-forms-form-fields-signaturefield%}) +- [Signing an Unsigned PDF Document that Contains a Signature Field with RadPdfProcessing]({%slug pdfprocessing-sign-an-unsigned-pdf%}) From b8bb8f4a4c3e7ec28864e48dc070cf7a97769010 Mon Sep 17 00:00:00 2001 From: Desislava Yordanova Date: Thu, 15 May 2025 10:06:49 +0300 Subject: [PATCH 2/3] add screenshot and adjust links with slugs --- ...ith-empty-signature-field-radpdfprocessing.md | 2 ++ knowledge-base/images/unsigned-pdf.png | Bin 0 -> 3191 bytes .../pdfprocessing-sign-an-unsigned-pdf.md | 1 + 3 files changed, 3 insertions(+) create mode 100644 knowledge-base/images/unsigned-pdf.png diff --git a/knowledge-base/create-pdf-with-empty-signature-field-radpdfprocessing.md b/knowledge-base/create-pdf-with-empty-signature-field-radpdfprocessing.md index 5bc7c562..b1a084ab 100644 --- a/knowledge-base/create-pdf-with-empty-signature-field-radpdfprocessing.md +++ b/knowledge-base/create-pdf-with-empty-signature-field-radpdfprocessing.md @@ -18,6 +18,8 @@ ticketid: 1687482 ## Description Learn how to create a PDF document with an empty signature field, which allows signing the document in any PDF viewer. The document should only contain the empty signature field, and when opened in a viewer, it should provide the option to sign. +![UnSigned PDF](images/unsigned-pdf.png) + ## Solution To create a PDF document with an empty [signature field]({%slug radpdfprocessing-model-interactive-forms-form-fields-signaturefield%}) using [RadPdfProcessing]({%slug radpdfprocessing-overview%}), follow these steps: diff --git a/knowledge-base/images/unsigned-pdf.png b/knowledge-base/images/unsigned-pdf.png new file mode 100644 index 0000000000000000000000000000000000000000..71ae6e38f30c7d9b81d0f95c63bc7365f4183f12 GIT binary patch literal 3191 zcmdUyS5y-U5{5%lq$`U`6S;tNRC-MSqx24;Ns|&#AoLI*fJzV21B5OmGyze{1q^U0 zM!JBAv>-|`gc@q7iw}G5%RRf#`!MaCIdkUen}6bs4YimVxEKHc0JDxZ*c1Su;=9O^ z^p`GtE)TTgB2f98YH0#$hk1w>1uay=Km!1%Pi8!EqPwWC_-I@E0{|@Dzl{nHt8f7T zn3#0H8s@?F>vMB3TR1O%8}_4=)uURDIa8O(1+s~P#HwmF8emW`fHMvwgm zHUIOju==VSw_g#0X?q;hJ5fCmY!>k;>eL2tWtB9})mFkqib2gyBWyk<-C5Y93nH@xZ ziTzoM_-0*yF6g*EiaenV1CranuDnF zrGdgw-3{c2W!g`vgj?1Mf4PY9FelkFvj_*s>dOaGQlxTItVfMHHjV4prNp^gi^c_T zxOcBdh?mgbP;7|I0QQJDv3}!x8-{>6g6)GTS{p1yKTRlBU;5D_+=YB;b$N)#Qg$7Z zun)%|#PXtVOHhP$foiz9-$7=X5sj;0h;EXHPqx^~95>v>%+~x)>0p=yxq@BM68J%K z9=R>!cgIin>+XD_EtQ84=IJMMQ)Rj50S%jRi&@^E3PFkzBgk_LVyML02AeXZ+yWS& zI9Yip>4L3(Mk4pMcfV_@m$C%4if56VT@ZnGUlrsR3%SH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u, 15 May 2025 13:35:37 +0300 Subject: [PATCH 3/3] Update create-pdf-with-empty-signature-field-radpdfprocessing.md --- .../create-pdf-with-empty-signature-field-radpdfprocessing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knowledge-base/create-pdf-with-empty-signature-field-radpdfprocessing.md b/knowledge-base/create-pdf-with-empty-signature-field-radpdfprocessing.md index b1a084ab..5d9869e5 100644 --- a/knowledge-base/create-pdf-with-empty-signature-field-radpdfprocessing.md +++ b/knowledge-base/create-pdf-with-empty-signature-field-radpdfprocessing.md @@ -1,6 +1,6 @@ --- title: Creating a PDF Document with an Empty Signature Field Using RadPdfProcessing -description: Learn how to create a PDF document with an empty signature field using the PdfProcessing library in a Document Processing environment. +description: Learn how to create a PDF document with an empty signature field using the PdfProcessing library of the Document Processing Libraries. type: how-to page_title: How to Add an Empty Signature Field to a PDF Document in RadPdfProcessing slug: create-pdf-with-empty-signature-field-radpdfprocessing