Skip to content

Commit b8e64cd

Browse files
Merge pull request #134 from SyncfusionExamples/Task-935620-Combobox
Task-935620- Editing the Combo Box Fields in a PDF Document
2 parents 99468d3 + 3f990da commit b8e64cd

4 files changed

Lines changed: 76 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.13.35617.110 d17.13
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enabling-Edit-Option-for-the-PdfComboboxField", "Enabling-Edit-Option-for-the-PdfComboboxField\Enabling-Edit-Option-for-the-PdfComboboxField.csproj", "{B042DC77-96A1-4EA8-9776-6F10B092BE24}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{B042DC77-96A1-4EA8-9776-6F10B092BE24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{B042DC77-96A1-4EA8-9776-6F10B092BE24}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{B042DC77-96A1-4EA8-9776-6F10B092BE24}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{B042DC77-96A1-4EA8-9776-6F10B092BE24}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {BDBFE219-C7AF-4C85-A096-0F5DCDB0360E}
24+
EndGlobalSection
25+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<RootNamespace>Enabling_Edit_Option_for_the_PdfComboboxField</RootNamespace>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="*" />
13+
</ItemGroup>
14+
15+
</Project>

Forms/Enabling-Edit-Option-for-the-PdfComboboxField/Enabling-Edit-Option-for-the-PdfComboboxField/Output/.gitkeep

Whitespace-only changes.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//Create a new PDF document
2+
using Syncfusion.Pdf.Graphics;
3+
using Syncfusion.Pdf.Interactive;
4+
using Syncfusion.Pdf;
5+
using Syncfusion.Drawing;
6+
7+
PdfDocument document = new PdfDocument();
8+
9+
//Add page
10+
PdfPage page = document.Pages.Add();
11+
12+
//Create a PDF standard font
13+
PdfFont font = new PdfStandardFont(PdfFontFamily.Courier, 12f);
14+
15+
//Create a combo box
16+
17+
PdfComboBoxField positionComboBox = new PdfComboBoxField(page, "positionComboBox");
18+
19+
//Set the combo box bounds
20+
positionComboBox.Bounds = new RectangleF(100, 115, 200, 20);
21+
22+
//Set the font
23+
positionComboBox.Font = font;
24+
25+
//Enable editing option
26+
positionComboBox.Editable = true;
27+
28+
//Add it to document
29+
document.Form.Fields.Add(positionComboBox);
30+
31+
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
32+
{
33+
//Save the PDF document to file stream.
34+
document.Save(outputFileStream);
35+
}
36+
document.Close(true);

0 commit comments

Comments
 (0)