Skip to content

Commit 3f990da

Browse files
committed
modified the sample
1 parent 65e6900 commit 3f990da

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

  • Forms/Enabling-Edit-Option-for-the-PdfComboboxField/Enabling-Edit-Option-for-the-PdfComboboxField
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
1-
//Create a new PDf document
2-
3-
using Syncfusion.Pdf;
1+
//Create a new PDF document
42
using Syncfusion.Pdf.Graphics;
53
using Syncfusion.Pdf.Interactive;
4+
using Syncfusion.Pdf;
65
using Syncfusion.Drawing;
76

87
PdfDocument document = new PdfDocument();
98

10-
//Creates a new page and adds it as the last page of the document
11-
9+
//Add page
1210
PdfPage page = document.Pages.Add();
1311

12+
//Create a PDF standard font
1413
PdfFont font = new PdfStandardFont(PdfFontFamily.Courier, 12f);
1514

1615
//Create a combo box
1716

1817
PdfComboBoxField positionComboBox = new PdfComboBoxField(page, "positionComboBox");
1918

20-
positionComboBox.Editable = true;
21-
19+
//Set the combo box bounds
2220
positionComboBox.Bounds = new RectangleF(100, 115, 200, 20);
2321

22+
//Set the font
2423
positionComboBox.Font = font;
2524

25+
//Enable editing option
2626
positionComboBox.Editable = true;
2727

2828
//Add it to document
29-
3029
document.Form.Fields.Add(positionComboBox);
3130

32-
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
31+
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
3332
{
3433
//Save the PDF document to file stream.
3534
document.Save(outputFileStream);
3635
}
37-
document.Close(true);
38-
36+
document.Close(true);

0 commit comments

Comments
 (0)