Skip to content

Commit 83bea4e

Browse files
committed
1004110-ug: Added GitHub details.
1 parent 5a34e51 commit 83bea4e

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

Document-Processing/PDF/PDF-Library/NET/Working-with-forms.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4511,7 +4511,7 @@ This section explains how to add a date text box field to a PDF form using the S
45114511
The following code example illustrates how to add a date field to a PDF form.
45124512

45134513
{% tabs %}
4514-
{% highlight c# tabtitle="C# [Cross-platform]" %}
4514+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/PDF-Examples/master/Forms/Add-a-date-field-to-a-PDF/.NET/Add-a-date-field-to-a-PDF/Program.cs" %}
45154515

45164516
using Syncfusion.Drawing;
45174517
using Syncfusion.Pdf;
@@ -4524,13 +4524,13 @@ using (PdfDocument pdfDocument = new PdfDocument())
45244524
PdfPage pdfPage = pdfDocument.Pages.Add();
45254525
// Create a text box field for entering the name
45264526
PdfTextBoxField nameField = new PdfTextBoxField(pdfPage, "DateField");
4527-
nameField.Bounds = new RectangleF(10, 40, 200, 20);
4527+
nameField.Bounds = new RectangleF(10, 40, 70, 20);
45284528
nameField.ToolTip = "Date";
45294529
nameField.Text = "12/01/1995";
45304530
//Set the scriptAction to submitButton
4531-
nameField.Actions.KeyPressed = new PdfJavaScriptAction("AFDate_KeystrokeEx(\"m/d/yy\")");
4532-
nameField.Actions.Format = new PdfJavaScriptAction("AFDate_FormatEx(\"m/d/yy\")");
4533-
nameField.Actions.Validate = new PdfJavaScriptAction("AFDate_Validate(\"m/d/yy\")");
4531+
nameField.Actions.KeyPressed = new PdfJavaScriptAction("AFDate_KeystrokeEx(\"mm/dd/yyyy\")");
4532+
nameField.Actions.Format = new PdfJavaScriptAction("AFDate_FormatEx(\"mm/dd/yyyy\")");
4533+
nameField.Actions.Validate = new PdfJavaScriptAction("AFDate_Validate(\"mm/dd/yyyy\")");
45344534
// Add the field to the form
45354535
pdfDocument.Form.Fields.Add(nameField);
45364536
// Save the PDF document
@@ -4550,13 +4550,13 @@ using (PdfDocument pdfDocument = new PdfDocument())
45504550
PdfPage pdfPage = pdfDocument.Pages.Add();
45514551
// Create a text box field for entering the name
45524552
PdfTextBoxField nameField = new PdfTextBoxField(pdfPage, "DateField");
4553-
nameField.Bounds = new RectangleF(10, 40, 200, 20);
4553+
nameField.Bounds = new RectangleF(10, 40, 70, 20);
45544554
nameField.ToolTip = "Date";
45554555
nameField.Text = "12/01/1995";
45564556
//Set the scriptAction to submitButton
4557-
nameField.Actions.KeyPressed = new PdfJavaScriptAction("AFDate_KeystrokeEx(\"m/d/yy\")");
4558-
nameField.Actions.Format = new PdfJavaScriptAction("AFDate_FormatEx(\"m/d/yy\")");
4559-
nameField.Actions.Validate = new PdfJavaScriptAction("AFDate_Validate(\"m/d/yy\")");
4557+
nameField.Actions.KeyPressed = new PdfJavaScriptAction("AFDate_KeystrokeEx(\"mm/dd/yyyy\")");
4558+
nameField.Actions.Format = new PdfJavaScriptAction("AFDate_FormatEx(\"mm/dd/yyyy\")");
4559+
nameField.Actions.Validate = new PdfJavaScriptAction("AFDate_Validate(\"mm/dd/yyyy\")");
45604560
// Add the field to the form
45614561
pdfDocument.Form.Fields.Add(nameField);
45624562
// Save the PDF document
@@ -4575,13 +4575,13 @@ Using pdfDocument As New PdfDocument()
45754575
Dim pdfPage As PdfPage = pdfDocument.Pages.Add()
45764576
' Create a text box field for entering the name
45774577
Dim nameField As New PdfTextBoxField(pdfPage, "DateField")
4578-
nameField.Bounds = New RectangleF(10, 40, 200, 20)
4578+
nameField.Bounds = New RectangleF(10, 40, 70, 20)
45794579
nameField.ToolTip = "Date"
45804580
nameField.Text = "12/01/1995"
45814581
' Set the scriptAction to submitButton
4582-
nameField.Actions.KeyPressed = New PdfJavaScriptAction("AFDate_KeystrokeEx(""m/d/yy"")")
4583-
nameField.Actions.Format = New PdfJavaScriptAction("AFDate_FormatEx(""m/d/yy"")")
4584-
nameField.Actions.Validate = New PdfJavaScriptAction("AFDate_Validate(""m/d/yy"")")
4582+
nameField.Actions.KeyPressed = New PdfJavaScriptAction("AFDate_KeystrokeEx(\"mm/dd/yyyy\")")
4583+
nameField.Actions.Format = New PdfJavaScriptAction("AFDate_FormatEx(\"mm/dd/yyyy\")")
4584+
nameField.Actions.Validate = New PdfJavaScriptAction("AFDate_Validate(\"mm/dd/yyyy\")")
45854585
' Add the field to the form
45864586
pdfDocument.Form.Fields.Add(nameField)
45874587
' Save the PDF document
@@ -4590,7 +4590,7 @@ End Using
45904590
{% endhighlight %}
45914591
{% endtabs %}
45924592

4593-
You can download a complete working sample from GitHub.
4593+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/Forms/Add-a-date-field-to-a-PDF/.NET).
45944594

45954595
## Unified radio button selection
45964596

0 commit comments

Comments
 (0)