diff --git a/Forms/Adding-Radio-Buttons-to-Multiple-PDF-Pages/.NET/Adding-Radio-Buttons-to-Multiple-PDF-Pages.sln b/Forms/Adding-Radio-Buttons-to-Multiple-PDF-Pages/.NET/Adding-Radio-Buttons-to-Multiple-PDF-Pages.sln new file mode 100644 index 00000000..e80e78d5 --- /dev/null +++ b/Forms/Adding-Radio-Buttons-to-Multiple-PDF-Pages/.NET/Adding-Radio-Buttons-to-Multiple-PDF-Pages.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35707.178 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Adding-Radio-Buttons-to-Multiple-PDF-Pages", "Adding-Radio-Buttons-to-Multiple-PDF-Pages\Adding-Radio-Buttons-to-Multiple-PDF-Pages.csproj", "{3B91CB77-3B67-4F35-850F-19E70AA1AEA7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3B91CB77-3B67-4F35-850F-19E70AA1AEA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B91CB77-3B67-4F35-850F-19E70AA1AEA7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B91CB77-3B67-4F35-850F-19E70AA1AEA7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B91CB77-3B67-4F35-850F-19E70AA1AEA7}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Forms/Adding-Radio-Buttons-to-Multiple-PDF-Pages/.NET/Adding-Radio-Buttons-to-Multiple-PDF-Pages/Adding-Radio-Buttons-to-Multiple-PDF-Pages.csproj b/Forms/Adding-Radio-Buttons-to-Multiple-PDF-Pages/.NET/Adding-Radio-Buttons-to-Multiple-PDF-Pages/Adding-Radio-Buttons-to-Multiple-PDF-Pages.csproj new file mode 100644 index 00000000..e3d44d0b --- /dev/null +++ b/Forms/Adding-Radio-Buttons-to-Multiple-PDF-Pages/.NET/Adding-Radio-Buttons-to-Multiple-PDF-Pages/Adding-Radio-Buttons-to-Multiple-PDF-Pages.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + Adding-Radio-Buttons-to-Multiple-PDF-Pages + enable + enable + + + + + + + diff --git a/Forms/Adding-Radio-Buttons-to-Multiple-PDF-Pages/.NET/Adding-Radio-Buttons-to-Multiple-PDF-Pages/Output/gitkeep.txt b/Forms/Adding-Radio-Buttons-to-Multiple-PDF-Pages/.NET/Adding-Radio-Buttons-to-Multiple-PDF-Pages/Output/gitkeep.txt new file mode 100644 index 00000000..e69de29b diff --git a/Forms/Adding-Radio-Buttons-to-Multiple-PDF-Pages/.NET/Adding-Radio-Buttons-to-Multiple-PDF-Pages/Program.cs b/Forms/Adding-Radio-Buttons-to-Multiple-PDF-Pages/.NET/Adding-Radio-Buttons-to-Multiple-PDF-Pages/Program.cs new file mode 100644 index 00000000..d3ad925b --- /dev/null +++ b/Forms/Adding-Radio-Buttons-to-Multiple-PDF-Pages/.NET/Adding-Radio-Buttons-to-Multiple-PDF-Pages/Program.cs @@ -0,0 +1,44 @@ +using Syncfusion.Pdf; +using Syncfusion.Pdf.Graphics; +using Syncfusion.Pdf.Interactive; +using Syncfusion.Drawing; + +// Create a new PDF document +using (PdfDocument document = new PdfDocument()) +{ + // Loop through multiple pages + for (int i = 1; i <= 5; i++) + { + // Add a new page to the PDF document + PdfPage page = document.Pages.Add(); + // Draw header text + page.Graphics.DrawString($"Radio Button Example - {i}", + new PdfStandardFont(PdfFontFamily.Helvetica, 20), + PdfBrushes.Black, new PointF(10, 30)); + // Create a Radio Button List Field + PdfRadioButtonListField employeesRadioList = new PdfRadioButtonListField(page, $"employeesRadioList_{i}") + { + AllowUnisonSelection = false // Each button acts independently + }; + // Add the radio button field to the form + document.Form.Fields.Add(employeesRadioList); + // Draw option labels + page.Graphics.DrawString("Option 1", new PdfStandardFont(PdfFontFamily.Helvetica, 12), + PdfBrushes.Black, new PointF(50, 70)); + page.Graphics.DrawString("Option 2", new PdfStandardFont(PdfFontFamily.Helvetica, 12), + PdfBrushes.Black, new PointF(50, 100)); + // Create radio button items with positions + PdfRadioButtonListItem radioButtonItem1 = new PdfRadioButtonListItem("Option1") + { + Bounds = new RectangleF(10, 70, 20, 20) + }; + PdfRadioButtonListItem radioButtonItem2 = new PdfRadioButtonListItem("Option2") + { + Bounds = new RectangleF(10, 100, 20, 20) + }; + // Add items to the radio button group + employeesRadioList.Items.Add(radioButtonItem1); + employeesRadioList.Items.Add(radioButtonItem2); + } + document.Save(Path.GetFullPath(@"Output/Output.pdf")); +} \ No newline at end of file