Skip to content

Commit 5ac03f2

Browse files
committed
260304: Added sample project for Enable Cache font.
1 parent 9a253fc commit 5ac03f2

File tree

10 files changed

+64
-6
lines changed

10 files changed

+64
-6
lines changed

Table/PdfGrid/Add-different-font-style-for-particular-table-cell/.NET/Add-different-font-style-for-particular-table-cell/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Syncfusion.Pdf.Grid;
33
using Syncfusion.Pdf;
44
using Syncfusion.Drawing;
5-
using System.Reflection.Metadata;
65

76
//Create a new PDF document.
87
using (PdfDocument document = new PdfDocument())

Table/PdfGrid/Add-the-background-image-in-a-PDF-table-cell/.NET/Add-the-background-image-in-a-PDF-table-cell/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Syncfusion.Pdf.Grid;
33
using Syncfusion.Pdf;
44
using Syncfusion.Drawing;
5-
using System.Reflection.Metadata;
65

76
//Create a new PDF document.
87
PdfDocument pdfDocument = new PdfDocument();

Table/PdfGrid/Create-nested-table-in-a-PDF-document/.NET/Create-nested-table-in-a-PDF-document/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Syncfusion.Pdf.Grid;
22
using Syncfusion.Pdf;
33
using Syncfusion.Drawing;
4-
using System.Reflection.Metadata;
54

65
//Create a new PDF document.
76
using (PdfDocument document = new PdfDocument())

Table/PdfGrid/Draw-HTML-styled-text-in-a-PDF-table-cell/.NET/Draw-HTML-styled-text-in-a-PDF-table-cell/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Syncfusion.Pdf.Graphics;
33
using Syncfusion.Pdf.Grid;
44
using Syncfusion.Drawing;
5-
using System.Reflection.Metadata;
65

76
//Create a new PDF document.
87
using (PdfDocument document = new PdfDocument())

Table/PdfGrid/Draw-borderless-table-in-PDF-document/.NET/Draw-borderless-table-in-PDF-document/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Syncfusion.Pdf.Grid;
33
using Syncfusion.Pdf;
44
using Syncfusion.Drawing;
5-
using System.Reflection.Metadata;
65

76
//Create a new PDF document.
87
using (PdfDocument document = new PdfDocument())

Table/PdfGrid/Insert-image-in-a-particular-table-cell/.NET/Insert-image-in-a-particular-table-cell/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Syncfusion.Pdf.Grid;
33
using Syncfusion.Pdf;
44
using Syncfusion.Drawing;
5-
using System.Reflection.Metadata;
65

76
//Create a new PDF document.
87
using (PdfDocument document = new PdfDocument())
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.14.36616.10 d17.14
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Disabling-Font-Caching-with-EnableCache", "Disabling-Font-Caching-with-EnableCache\Disabling-Font-Caching-with-EnableCache.csproj", "{92C54F48-8703-4E32-810B-04C869DF545C}"
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+
{92C54F48-8703-4E32-810B-04C869DF545C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{92C54F48-8703-4E32-810B-04C869DF545C}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{92C54F48-8703-4E32-810B-04C869DF545C}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{92C54F48-8703-4E32-810B-04C869DF545C}.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 = {325DD53E-879D-40D7-9F48-6A67B8EB5E33}
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>Disabling_Font_Caching_with_EnableCache</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>

Text/Disabling-Font-Caching-with-EnableCache/.NET/Disabling-Font-Caching-with-EnableCache/Output/gitkeep.txt

Whitespace-only changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using Syncfusion.Drawing;
2+
using Syncfusion.Pdf;
3+
using Syncfusion.Pdf.Graphics;
4+
5+
//Create a new document.
6+
using (PdfDocument document = new PdfDocument())
7+
{
8+
//Diable the font cache
9+
PdfDocument.EnableCache = false;
10+
11+
//Creates a new page and adds it as the last page of the document
12+
PdfPage page = document.Pages.Add();
13+
//Create Pdf graphics for the page
14+
PdfGraphics graphics = page.Graphics;
15+
//Create a solid brush
16+
PdfBrush brush = new PdfSolidBrush(Color.Black);
17+
float fontSize = 20f;
18+
//Set the font
19+
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, fontSize);
20+
//Draw the text
21+
graphics.DrawString("Hello world!", font, brush, new PointF(20, 20));
22+
//Save the PDF document
23+
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
24+
}

0 commit comments

Comments
 (0)