-
Notifications
You must be signed in to change notification settings - Fork 48
264229 Added sample for added radio button fields in multiple PDF pages #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sameerkhan001
wants to merge
3
commits into
master
Choose a base branch
from
264229
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...g-Radio-Buttons-to-Multiple-PDF-Pages/.NET/Adding-Radio-Buttons-to-Multiple-PDF-Pages.sln
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
15 changes: 15 additions & 0 deletions
15
...ing-Radio-Buttons-to-Multiple-PDF-Pages/Adding-Radio-Buttons-to-Multiple-PDF-Pages.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <RootNamespace>Adding-Radio-Buttons-to-Multiple-PDF-Pages</RootNamespace> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Syncfusion.Pdf.Net.Core" Version="*" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
Empty file.
44 changes: 44 additions & 0 deletions
44
...-Buttons-to-Multiple-PDF-Pages/.NET/Adding-Radio-Buttons-to-Multiple-PDF-Pages/Program.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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")); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a requirement. The exact requirement is to add the radio button items to multiple pages. For example, if the page one contains a radio button with 3 kids, the same radio button is need to be added on the page with the same group, then we have to provide option to add the page for that particular radio button items