Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36221.1 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Setting-Section-Page-Numbers-With-Custom-Styles", "Setting-Section-Page-Numbers-With-Custom-Styles\Setting-Section-Page-Numbers-With-Custom-Styles.csproj", "{73050DDC-B7A3-48AC-AAF9-72B3710424DC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{73050DDC-B7A3-48AC-AAF9-72B3710424DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{73050DDC-B7A3-48AC-AAF9-72B3710424DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{73050DDC-B7A3-48AC-AAF9-72B3710424DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{73050DDC-B7A3-48AC-AAF9-72B3710424DC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BD540509-74DF-4C8F-9D94-6D807B315F6C}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;

//Create a new document.
PdfDocument document = new PdfDocument();
//Add the section.
PdfSection section = document.Sections.Add();
//Set the font.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Create section page number field.
PdfSectionPageNumberField sectionPageNumber = new PdfSectionPageNumberField();
//Set the page number style as LowerRoman
sectionPageNumber.NumberStyle = PdfNumberStyle.LowerRoman;
sectionPageNumber.Font = font;
//Draw the sectionPageNumber in section.
for (int i = 0; i < 3; i++)
{
PdfPage page = section.Pages.Add();
sectionPageNumber.Draw(page.Graphics);
Comment thread
sameerkhan001 marked this conversation as resolved.
Outdated
page.Graphics.DrawString("This code is a practical example of how to automatically add Roman numeral page numbers", font, PdfBrushes.Black, new Syncfusion.Drawing.PointF(10, 0));
}
//Create file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document to file stream.
document.Save(outputFileStream);
}
//Close the document.
document.Close(true);
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>Setting-Section-Page-Numbers-With-Custom-Styles</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="*" />
</ItemGroup>

</Project>
Loading