diff --git a/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration.slnx b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration.slnx new file mode 100644 index 00000000..ce5e596a --- /dev/null +++ b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration.slnx @@ -0,0 +1,3 @@ + + + diff --git a/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Custom-font-registration.csproj b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Custom-font-registration.csproj new file mode 100644 index 00000000..4164782b --- /dev/null +++ b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Custom-font-registration.csproj @@ -0,0 +1,27 @@ + + + + Exe + net10.0 + Custom_font_registration + enable + enable + + + + + + + + + Always + + + Always + + + Always + + + + diff --git a/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Data/Template.pptx b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Data/Template.pptx new file mode 100644 index 00000000..fb211f67 Binary files /dev/null and b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Data/Template.pptx differ diff --git a/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/Aptos.ttf b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/Aptos.ttf new file mode 100644 index 00000000..e19d992b Binary files /dev/null and b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/Aptos.ttf differ diff --git a/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/CHILLER.TTF b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/CHILLER.TTF new file mode 100644 index 00000000..3ebfa84c Binary files /dev/null and b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/CHILLER.TTF differ diff --git a/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/arial.ttf b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/arial.ttf new file mode 100644 index 00000000..b9d884bc Binary files /dev/null and b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/arial.ttf differ diff --git a/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/roboto.ttf b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/roboto.ttf new file mode 100644 index 00000000..307a18c1 Binary files /dev/null and b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/roboto.ttf differ diff --git a/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/robotob.ttf b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/robotob.ttf new file mode 100644 index 00000000..277b5aeb Binary files /dev/null and b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/robotob.ttf differ diff --git a/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/robotoz.ttf b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/robotoz.ttf new file mode 100644 index 00000000..47b6f70a Binary files /dev/null and b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/robotoz.ttf differ diff --git a/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/times.ttf b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/times.ttf new file mode 100644 index 00000000..11d6b508 Binary files /dev/null and b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/times.ttf differ diff --git a/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Output/.gitkeep b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Program.cs b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Program.cs new file mode 100644 index 00000000..086b32f5 --- /dev/null +++ b/PPTX-to-Image-conversion/Custom-font-registration/.NET/Custom-font-registration/Program.cs @@ -0,0 +1,42 @@ +using Syncfusion.Drawing.Fonts; +using Syncfusion.Presentation; +using Syncfusion.PresentationRenderer; +using Syncfusion.Telemetry; + +namespace Custom_font_registration +{ + class Program + { + public static void Main(string[] args) + { + FontManager.RegisterFonts(Path.GetFullPath(@"Fonts")); + List registerFont = FontManager.RegisteredFontNames; + PPTXtoImage(); + FontManager.ClearRegisteredFonts(true); + } + + private static void PPTXtoImage() + { + //Open the existing PowerPoint presentation. + using (IPresentation pptxDoc = Presentation.Open(Path.GetFullPath(@"Data/Template.pptx"))) + { + //Initialize PresentationRenderer. + pptxDoc.PresentationRenderer = new PresentationRenderer(); + //Convert the PowerPoint presentation as image streams. + Stream[] images = pptxDoc.RenderAsImages(ExportImageFormat.Png); + //Save the image streams to file. + for (int i = 0; i < images.Length; i++) + { + using (Stream stream = images[i]) + { + using (FileStream fileStreamOutput = File.Create(Path.GetFullPath(@"Output/PPTXtoImage" + i + ".png"))) + { + stream.CopyTo(fileStreamOutput); + } + } + } + } + } + + } +} diff --git a/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration.slnx b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration.slnx new file mode 100644 index 00000000..ce5e596a --- /dev/null +++ b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration.slnx @@ -0,0 +1,3 @@ + + + diff --git a/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Custom-font-registration.csproj b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Custom-font-registration.csproj new file mode 100644 index 00000000..8f3fc843 --- /dev/null +++ b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Custom-font-registration.csproj @@ -0,0 +1,27 @@ + + + + Exe + net10.0 + Custom_font_registration + enable + enable + + + + + + + + + Always + + + Always + + + Always + + + + diff --git a/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Data/Template.pptx b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Data/Template.pptx new file mode 100644 index 00000000..fb211f67 Binary files /dev/null and b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Data/Template.pptx differ diff --git a/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/Aptos.ttf b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/Aptos.ttf new file mode 100644 index 00000000..e19d992b Binary files /dev/null and b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/Aptos.ttf differ diff --git a/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/CHILLER.TTF b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/CHILLER.TTF new file mode 100644 index 00000000..3ebfa84c Binary files /dev/null and b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/CHILLER.TTF differ diff --git a/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/arial.ttf b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/arial.ttf new file mode 100644 index 00000000..b9d884bc Binary files /dev/null and b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/arial.ttf differ diff --git a/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/roboto.ttf b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/roboto.ttf new file mode 100644 index 00000000..307a18c1 Binary files /dev/null and b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/roboto.ttf differ diff --git a/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/robotob.ttf b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/robotob.ttf new file mode 100644 index 00000000..277b5aeb Binary files /dev/null and b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/robotob.ttf differ diff --git a/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/robotoz.ttf b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/robotoz.ttf new file mode 100644 index 00000000..47b6f70a Binary files /dev/null and b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/robotoz.ttf differ diff --git a/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/times.ttf b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/times.ttf new file mode 100644 index 00000000..11d6b508 Binary files /dev/null and b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Fonts/times.ttf differ diff --git a/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Output/.gitkeep b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Program.cs b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Program.cs new file mode 100644 index 00000000..d1d7b0f8 --- /dev/null +++ b/PPTX-to-PDF-conversion/Custom-font-registration/.NET/Custom-font-registration/Program.cs @@ -0,0 +1,32 @@ +using Syncfusion.Drawing.Fonts; +using Syncfusion.Pdf; +using Syncfusion.Presentation; +using Syncfusion.PresentationRenderer; + +namespace Custom_font_registration +{ + class Program + { + public static void Main(string[] args) + { + FontManager.RegisterFonts(Path.GetFullPath(@"Fonts")); + List registerFont = FontManager.RegisteredFontNames; + PPTXtoPDF(); + FontManager.ClearRegisteredFonts(true); + } + + private static void PPTXtoPDF() + { + IPresentation presentation = Presentation.Open(Path.GetFullPath(@"Data/Template.pptx")); + //Converts the PowerPoint Presentation into PDF document + PdfDocument pdfDocument = PresentationToPdfConverter.Convert(presentation); + //Saves the PDF document + pdfDocument.Save(Path.GetFullPath(@"Output/Output.pdf")); + //Closes the PDF document + pdfDocument.Close(true); + //Closes the Presentation + presentation.Close(); + } + + } +}