Skip to content

Commit cd8263f

Browse files
committed
commited example for this UG
1 parent f80debc commit cd8263f

21 files changed

+231
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md
26+
!**/.gitignore
27+
!.git/HEAD
28+
!.git/config
29+
!.git/packed-refs
30+
!.git/refs/heads/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"Version": 1,
3+
"WorkspaceRootPath": "C:\\Users\\IrfanaJafferSadhik\\source\\repos\\Changing-Checkmark-and-RadioButton-Colors-in-PDF\\",
4+
"Documents": [
5+
{
6+
"AbsoluteMoniker": "D:0:0:{3DB23055-CE19-4219-98E7-A7292FE77EA8}|Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Changing-Checkmark-and-RadioButton-Colors-in-PDF.csproj|c:\\users\\irfanajaffersadhik\\source\\repos\\changing-checkmark-and-radiobutton-colors-in-pdf\\changing-checkmark-and-radiobutton-colors-in-pdf\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
7+
"RelativeMoniker": "D:0:0:{3DB23055-CE19-4219-98E7-A7292FE77EA8}|Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Changing-Checkmark-and-RadioButton-Colors-in-PDF.csproj|solutionrelative:changing-checkmark-and-radiobutton-colors-in-pdf\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
8+
}
9+
],
10+
"DocumentGroupContainers": [
11+
{
12+
"Orientation": 0,
13+
"VerticalTabListWidth": 256,
14+
"DocumentGroups": [
15+
{
16+
"DockedWidth": 200,
17+
"SelectedChildIndex": 2,
18+
"Children": [
19+
{
20+
"$type": "Bookmark",
21+
"Name": "ST:0:0:{34e76e81-ee4a-11d0-ae2e-00a0c90fffc3}"
22+
},
23+
{
24+
"$type": "Bookmark",
25+
"Name": "ST:0:0:{d78612c7-9962-4b83-95d9-268046dad23a}"
26+
},
27+
{
28+
"$type": "Document",
29+
"DocumentIndex": 0,
30+
"Title": "Program.cs",
31+
"DocumentMoniker": "C:\\Users\\IrfanaJafferSadhik\\source\\repos\\Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Program.cs",
32+
"RelativeDocumentMoniker": "Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Program.cs",
33+
"ToolTip": "C:\\Users\\IrfanaJafferSadhik\\source\\repos\\Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Program.cs",
34+
"RelativeToolTip": "Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Program.cs",
35+
"ViewState": "AgIAAAUAAAAAAAAAAAAhwA8AAAABAAAAAAAAAA==",
36+
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
37+
"WhenOpened": "2025-06-12T09:57:37.489Z",
38+
"EditorCaption": ""
39+
}
40+
]
41+
}
42+
]
43+
}
44+
]
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"Version": 1,
3+
"WorkspaceRootPath": "C:\\Users\\IrfanaJafferSadhik\\source\\repos\\Changing-Checkmark-and-RadioButton-Colors-in-PDF\\",
4+
"Documents": [
5+
{
6+
"AbsoluteMoniker": "D:0:0:{3DB23055-CE19-4219-98E7-A7292FE77EA8}|Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Changing-Checkmark-and-RadioButton-Colors-in-PDF.csproj|c:\\users\\irfanajaffersadhik\\source\\repos\\changing-checkmark-and-radiobutton-colors-in-pdf\\changing-checkmark-and-radiobutton-colors-in-pdf\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
7+
"RelativeMoniker": "D:0:0:{3DB23055-CE19-4219-98E7-A7292FE77EA8}|Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Changing-Checkmark-and-RadioButton-Colors-in-PDF.csproj|solutionrelative:changing-checkmark-and-radiobutton-colors-in-pdf\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
8+
}
9+
],
10+
"DocumentGroupContainers": [
11+
{
12+
"Orientation": 0,
13+
"VerticalTabListWidth": 256,
14+
"DocumentGroups": [
15+
{
16+
"DockedWidth": 200,
17+
"SelectedChildIndex": 2,
18+
"Children": [
19+
{
20+
"$type": "Bookmark",
21+
"Name": "ST:0:0:{34e76e81-ee4a-11d0-ae2e-00a0c90fffc3}"
22+
},
23+
{
24+
"$type": "Bookmark",
25+
"Name": "ST:0:0:{d78612c7-9962-4b83-95d9-268046dad23a}"
26+
},
27+
{
28+
"$type": "Document",
29+
"DocumentIndex": 0,
30+
"Title": "Program.cs",
31+
"DocumentMoniker": "C:\\Users\\IrfanaJafferSadhik\\source\\repos\\Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Program.cs",
32+
"RelativeDocumentMoniker": "Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Program.cs",
33+
"ToolTip": "C:\\Users\\IrfanaJafferSadhik\\source\\repos\\Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Program.cs",
34+
"RelativeToolTip": "Changing-Checkmark-and-RadioButton-Colors-in-PDF\\Program.cs",
35+
"ViewState": "AgIAAB0AAAAAAAAAAAAhwCAAAAAHAAAAAAAAAA==",
36+
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
37+
"WhenOpened": "2025-06-12T09:57:37.489Z",
38+
"EditorCaption": ""
39+
}
40+
]
41+
}
42+
]
43+
}
44+
]
45+
}
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}") = "Changing-Checkmark-and-RadioButton-Colors-in-PDF", "Changing-Checkmark-and-RadioButton-Colors-in-PDF\Changing-Checkmark-and-RadioButton-Colors-in-PDF.csproj", "{3DB23055-CE19-4219-98E7-A7292FE77EA8}"
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+
{3DB23055-CE19-4219-98E7-A7292FE77EA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{3DB23055-CE19-4219-98E7-A7292FE77EA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{3DB23055-CE19-4219-98E7-A7292FE77EA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{3DB23055-CE19-4219-98E7-A7292FE77EA8}.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 = {33BA272D-C49E-455A-8278-DDDE867443E1}
24+
EndGlobalSection
25+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<RootNamespace>Changing_Checkmark_and_RadioButton_Colors_in_PDF</RootNamespace>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<None Remove="Data\Input.pdf" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<EmbeddedResource Include="Data\Input.pdf">
18+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
19+
</EmbeddedResource>
20+
</ItemGroup>
21+
22+
<ItemGroup>
23+
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
24+
<PackageReference Include="Syncfusion.Pdf.NET" Version="29.2.10" />
25+
</ItemGroup>
26+
27+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<ActiveDebugProfile>Changing-Checkmark-and-RadioButton-Colors-in-PDF</ActiveDebugProfile>
5+
</PropertyGroup>
6+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
7+
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
8+
</PropertyGroup>
9+
</Project>

Forms/Changing-Checkmark-and-RadioButton-Colors-in-PDF/Changing-Checkmark-and-RadioButton-Colors-in-PDF/Output/.gitkeep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// See https://aka.ms/new-console-template for more information
2+
3+
using Syncfusion.Drawing;
4+
using Syncfusion.Pdf;
5+
using Syncfusion.Pdf.Interactive;
6+
using Syncfusion.Pdf.Parsing;
7+
using System.IO;
8+
9+
FileStream fileStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read);
10+
// Load the PDF document
11+
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(fileStream);
12+
// Access the existing form fields
13+
PdfLoadedForm form = loadedDocument.Form;
14+
// Iterate through the fields
15+
foreach (PdfLoadedField field in form.Fields)
16+
{
17+
// Check for checkbox fields
18+
if (field is PdfLoadedCheckBoxField checkBoxField)
19+
{
20+
checkBoxField.ForeColor = Color.Red; // Set desired color
21+
}
22+
// Check for radio button fields
23+
else if (field is PdfLoadedRadioButtonListField radioButtonField)
24+
{
25+
foreach (PdfLoadedRadioButtonItem item in radioButtonField.Items)
26+
{
27+
item.ForeColor = Color.Blue; // Set desired color
28+
}
29+
}
30+
}
31+
32+
//Create file stream.
33+
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
34+
{
35+
//Save the PDF document to file stream.
36+
loadedDocument.Save(outputFileStream);
37+
}
38+
39+
//Close the document.
40+
loadedDocument.Close(true);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"profiles": {
3+
"Changing-Checkmark-and-RadioButton-Colors-in-PDF": {
4+
"commandName": "Project"
5+
},
6+
"Container (Dockerfile)": {
7+
"commandName": "Docker"
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)