diff --git a/Getting-started/COM-Interop/Create-PowerPoint-Presentation-Script.vbs b/Getting-started/COM-Interop/Create-PowerPoint-Presentation-Script.vbs new file mode 100644 index 00000000..4cd1046a --- /dev/null +++ b/Getting-started/COM-Interop/Create-PowerPoint-Presentation-Script.vbs @@ -0,0 +1,31 @@ +Option Explicit +On Error Resume Next + +' --- Change this output path as you want --- +Dim outputPath +outputPath = "D:\Output.pptx" + +' Create the COM object exposed by your .NET class +' ProgID must match the [ProgId] attribute in your C# class +Dim obj +Set obj = CreateObject("Create_PowerPoint_Presentation.Class1") + +If Err.Number <> 0 Then + MsgBox "Failed to create COM object 'Create_PowerPoint_Presentation.Class1'." & vbCrLf & _ + "Error " & Err.Number & ": " & Err.Description, vbCritical, "COM Error" + WScript.Quit 1 +End If + +' Call the method exposed by your class +obj.CreatePowerPointPresentation outputPath + +If Err.Number <> 0 Then + MsgBox "Method call failed (CreatePowerPointPresentation)." & vbCrLf & _ + "Error " & Err.Number & ": " & Err.Description, vbCritical, "Invoke Error" + WScript.Quit 2 +End If + +' Release the COM object +Set obj = Nothing + +MsgBox "Success!" & vbCrLf & "Document created at:" & vbCrLf & outputPath, vbInformation, "Done" diff --git a/Getting-started/COM-Interop/Create-PowerPoint-Presentation.sln b/Getting-started/COM-Interop/Create-PowerPoint-Presentation.sln new file mode 100644 index 00000000..cc73842e --- /dev/null +++ b/Getting-started/COM-Interop/Create-PowerPoint-Presentation.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.37111.16 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Create-PowerPoint-Presentation", "Create-PowerPoint-Presentation\Create-PowerPoint-Presentation.csproj", "{CFC430EC-97EF-4726-A8FD-BFCABB3CADE8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CFC430EC-97EF-4726-A8FD-BFCABB3CADE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFC430EC-97EF-4726-A8FD-BFCABB3CADE8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFC430EC-97EF-4726-A8FD-BFCABB3CADE8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFC430EC-97EF-4726-A8FD-BFCABB3CADE8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8D140AA4-F442-49D5-A550-C311C5A0B72D} + EndGlobalSection +EndGlobal diff --git a/Getting-started/COM-Interop/Create-PowerPoint-Presentation/Class1.cs b/Getting-started/COM-Interop/Create-PowerPoint-Presentation/Class1.cs new file mode 100644 index 00000000..6296148b --- /dev/null +++ b/Getting-started/COM-Interop/Create-PowerPoint-Presentation/Class1.cs @@ -0,0 +1,64 @@ +using Syncfusion.Presentation; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Create_PowerPoint_Presentation +{ + [ComVisible(true)] + [Guid("6F6B4A3C-5C98-4D63-8C7A-5B2C0F1D9E11")] // Use a unique GUID + [ProgId("Create_PowerPoint_Presentation.Class1")] // Stable ProgID for VBScript + [ClassInterface(ClassInterfaceType.AutoDual)] + public class Class1 + { + public void CreatePowerPointPresentation(string outputFilePath) + { + //Create a new instance of PowerPoint Presentation file + using (IPresentation pptxDoc = Presentation.Create()) + { + //Add a new slide to file and apply background color + ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.TitleOnly); + //Specify the fill type and fill color for the slide background + slide.Background.Fill.FillType = FillType.Solid; + slide.Background.Fill.SolidFill.Color = ColorObject.FromArgb(232, 241, 229); + //Add title content to the slide by accessing the title placeholder of the TitleOnly layout-slide + IShape titleShape = slide.Shapes[0] as IShape; + titleShape.TextBody.AddParagraph("Company History").HorizontalAlignment = HorizontalAlignmentType.Center; + //Add description content to the slide by adding a new TextBox + IShape descriptionShape = slide.AddTextBox(53.22, 141.73, 874.19, 77.70); + descriptionShape.TextBody.Text = "IMN Solutions PVT LTD is the software company, established in 1987, by George Milton. The company has been listed as the trusted partner for many high-profile organizations since 1988 and got awards for quality products from reputed organizations."; + //Add bullet points to the slide + IShape bulletPointsShape = slide.AddTextBox(53.22, 270, 437.90, 116.32); + + //Add a paragraph for a bullet point + IParagraph firstPara = bulletPointsShape.TextBody.AddParagraph("The company acquired the MCY corporation for 20 billion dollars and became the top revenue maker for the year 2015."); + + //Format how the bullets should be displayed + firstPara.ListFormat.Type = ListType.Bulleted; + firstPara.LeftIndent = 35; + firstPara.FirstLineIndent = -35; + + // Add another paragraph for the next bullet point + IParagraph secondPara = bulletPointsShape.TextBody.AddParagraph("The company is participating in top open source projects in automation industry."); + + //Format how the bullets should be displayed + secondPara.ListFormat.Type = ListType.Bulleted; + secondPara.LeftIndent = 35; + secondPara.FirstLineIndent = -35; + + //Add an auto-shape to the slide + IShape stampShape = slide.Shapes.AddShape(AutoShapeType.Explosion1, 48.93, 430.71, 104.13, 80.54); + + //Format the auto-shape color by setting the fill type and text + stampShape.Fill.FillType = FillType.None; + stampShape.TextBody.AddParagraph("IMN").HorizontalAlignment = HorizontalAlignmentType.Center; + //Save the PowerPoint Presentation + pptxDoc.Save(outputFilePath); + } + } + } +} diff --git a/Getting-started/COM-Interop/Create-PowerPoint-Presentation/Create-PowerPoint-Presentation.csproj b/Getting-started/COM-Interop/Create-PowerPoint-Presentation/Create-PowerPoint-Presentation.csproj new file mode 100644 index 00000000..32a515cc --- /dev/null +++ b/Getting-started/COM-Interop/Create-PowerPoint-Presentation/Create-PowerPoint-Presentation.csproj @@ -0,0 +1,63 @@ + + + + + Debug + AnyCPU + {CFC430EC-97EF-4726-A8FD-BFCABB3CADE8} + Library + Properties + Create_PowerPoint_Presentation + Create-PowerPoint-Presentation + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Syncfusion.Compression.Base.33.1.44\lib\net462\Syncfusion.Compression.Base.dll + + + ..\packages\Syncfusion.Licensing.33.1.44\lib\net462\Syncfusion.Licensing.dll + + + ..\packages\Syncfusion.OfficeChart.Base.33.1.44\lib\net462\Syncfusion.OfficeChart.Base.dll + + + ..\packages\Syncfusion.Presentation.WinForms.33.1.44\lib\net462\Syncfusion.Presentation.Base.dll + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Getting-started/COM-Interop/Create-PowerPoint-Presentation/Data/Output.pptx b/Getting-started/COM-Interop/Create-PowerPoint-Presentation/Data/Output.pptx new file mode 100644 index 00000000..738afbae Binary files /dev/null and b/Getting-started/COM-Interop/Create-PowerPoint-Presentation/Data/Output.pptx differ diff --git a/Getting-started/COM-Interop/Create-PowerPoint-Presentation/Properties/AssemblyInfo.cs b/Getting-started/COM-Interop/Create-PowerPoint-Presentation/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..3e4a9a97 --- /dev/null +++ b/Getting-started/COM-Interop/Create-PowerPoint-Presentation/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Create-PowerPoint-Presentation")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Create-PowerPoint-Presentation")] +[assembly: AssemblyCopyright("Copyright © 2026")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("cfc430ec-97ef-4726-a8fd-bfcabb3cade8")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Getting-started/COM-Interop/Create-PowerPoint-Presentation/packages.config b/Getting-started/COM-Interop/Create-PowerPoint-Presentation/packages.config new file mode 100644 index 00000000..647d77ac --- /dev/null +++ b/Getting-started/COM-Interop/Create-PowerPoint-Presentation/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image-Script.vbs b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image-Script.vbs new file mode 100644 index 00000000..5cf48284 --- /dev/null +++ b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image-Script.vbs @@ -0,0 +1,34 @@ +Option Explicit +On Error Resume Next + +' --- Change this input and output path as you want --- +Dim inputPath +inputPath = "D:\Template.pptx" + +Dim outputPath +outputPath = "D:\Output.jpeg" + +' Create the COM object exposed by your .NET class +' ProgID must match the [ProgId] attribute in your C# class +Dim obj +Set obj = CreateObject("Convert_PowerPoint_Presentation_to_Image.Class1") + +If Err.Number <> 0 Then + MsgBox "Failed to create COM object 'Convert_PowerPoint_Presentation_to_Image.Class1'." & vbCrLf & _ + "Error " & Err.Number & ": " & Err.Description, vbCritical, "COM Error" + WScript.Quit 1 +End If + +' Call the method exposed by your class +obj.ConvertPowerPointPresentationtoImage inputPath, outputPath + +If Err.Number <> 0 Then + MsgBox "Method call failed (ConvertPowerPointPresentationtoImage)." & vbCrLf & _ + "Error " & Err.Number & ": " & Err.Description, vbCritical, "Invoke Error" + WScript.Quit 2 +End If + +' Release the COM object +Set obj = Nothing + +MsgBox "Success!" & vbCrLf & "Document created at:" & vbCrLf & outputPath, vbInformation, "Done" diff --git a/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image.sln b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image.sln new file mode 100644 index 00000000..75e8cd5d --- /dev/null +++ b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.37203.1 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Convert-PowerPoint-Presentation-to-Image", "Convert-PowerPoint-Presentation-to-Image\Convert-PowerPoint-Presentation-to-Image.csproj", "{F68DB0D1-0790-4F13-9AB5-DF895D6A6A54}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F68DB0D1-0790-4F13-9AB5-DF895D6A6A54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F68DB0D1-0790-4F13-9AB5-DF895D6A6A54}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F68DB0D1-0790-4F13-9AB5-DF895D6A6A54}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F68DB0D1-0790-4F13-9AB5-DF895D6A6A54}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {48052932-0939-4B79-9F4B-E582DA10AD9D} + EndGlobalSection +EndGlobal diff --git a/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Class1.cs b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Class1.cs new file mode 100644 index 00000000..909dfa07 --- /dev/null +++ b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Class1.cs @@ -0,0 +1,30 @@ +using Syncfusion.Drawing; +using Syncfusion.Presentation; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Convert_PowerPoint_Presentation_to_Image +{ + [ComVisible(true)] + [Guid("6F6B4A3C-5C98-4D63-8C7A-5B2C0F1D9E11")] // Use a unique GUID + [ProgId("Convert_PowerPoint_Presentation_to_Image.Class1")] // Stable ProgID for VBScript + [ClassInterface(ClassInterfaceType.AutoDual)] + public class Class1 + { + public void ConvertPowerPointPresentationtoImage(string inputFilePath, string outputFilePath) + { + //Open a PowerPoint Presentation. + using (IPresentation pptxDoc = Presentation.Open(inputFilePath)) + { + //Converts the first slide into image. + System.Drawing.Image image = pptxDoc.Slides[0].ConvertToImage(Syncfusion.Drawing.ImageType.Metafile); + //Save the image as jpeg. + image.Save(outputFilePath); + } + } + } +} diff --git a/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Convert-PowerPoint-Presentation-to-Image.csproj b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Convert-PowerPoint-Presentation-to-Image.csproj new file mode 100644 index 00000000..27b65bb1 --- /dev/null +++ b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Convert-PowerPoint-Presentation-to-Image.csproj @@ -0,0 +1,64 @@ + + + + + Debug + AnyCPU + {F68DB0D1-0790-4F13-9AB5-DF895D6A6A54} + Library + Properties + Convert_PowerPoint_Presentation_to_Image + Convert-PowerPoint-Presentation-to-Image + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Syncfusion.Compression.Base.33.1.44\lib\net462\Syncfusion.Compression.Base.dll + + + ..\packages\Syncfusion.Licensing.33.1.44\lib\net462\Syncfusion.Licensing.dll + + + ..\packages\Syncfusion.OfficeChart.Base.33.1.44\lib\net462\Syncfusion.OfficeChart.Base.dll + + + ..\packages\Syncfusion.Presentation.WinForms.33.1.44\lib\net462\Syncfusion.Presentation.Base.dll + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Data/Output.jpeg b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Data/Output.jpeg new file mode 100644 index 00000000..fad8dcf5 Binary files /dev/null and b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Data/Output.jpeg differ diff --git a/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Data/Template.pptx b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Data/Template.pptx new file mode 100644 index 00000000..5746d9bf Binary files /dev/null and b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Data/Template.pptx differ diff --git a/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Properties/AssemblyInfo.cs b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..3ced1f73 --- /dev/null +++ b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Convert-PowerPoint-Presentation-to-Image")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Convert-PowerPoint-Presentation-to-Image")] +[assembly: AssemblyCopyright("Copyright © 2026")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f68db0d1-0790-4f13-9ab5-df895d6a6a54")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/packages.config b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/packages.config new file mode 100644 index 00000000..647d77ac --- /dev/null +++ b/PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/COM-Interop/Convert-PowerPoint-Presentation-to-Image/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF-Script.vbs b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF-Script.vbs new file mode 100644 index 00000000..7350a926 --- /dev/null +++ b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF-Script.vbs @@ -0,0 +1,34 @@ +Option Explicit +On Error Resume Next + +' --- Change this input and output path as you want --- +Dim inputPath +inputPath = "D:\Template.pptx" + +Dim outputPath +outputPath = "D:\Output.pdf" + +' Create the COM object exposed by your .NET class +' ProgID must match the [ProgId] attribute in your C# class +Dim obj +Set obj = CreateObject("Convert_PowerPoint_Presentation_to_PDF.Class1") + +If Err.Number <> 0 Then + MsgBox "Failed to create COM object 'Convert_PowerPoint_Presentation_to_PDF.Class1'." & vbCrLf & _ + "Error " & Err.Number & ": " & Err.Description, vbCritical, "COM Error" + WScript.Quit 1 +End If + +' Call the method exposed by your class +obj.ConvertPowerPointPresentationtoPDF inputPath, outputPath + +If Err.Number <> 0 Then + MsgBox "Method call failed (ConvertPowerPointPresentationtoPDF)." & vbCrLf & _ + "Error " & Err.Number & ": " & Err.Description, vbCritical, "Invoke Error" + WScript.Quit 2 +End If + +' Release the COM object +Set obj = Nothing + +MsgBox "Success!" & vbCrLf & "Document created at:" & vbCrLf & outputPath, vbInformation, "Done" diff --git a/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF.sln b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF.sln new file mode 100644 index 00000000..cc96f671 --- /dev/null +++ b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.37203.1 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Convert-PowerPoint-Presentation-to-PDF", "Convert-PowerPoint-Presentation-to-PDF\Convert-PowerPoint-Presentation-to-PDF.csproj", "{B38D2B86-2F41-4B81-8F12-6692A17A7B0E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B38D2B86-2F41-4B81-8F12-6692A17A7B0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B38D2B86-2F41-4B81-8F12-6692A17A7B0E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B38D2B86-2F41-4B81-8F12-6692A17A7B0E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B38D2B86-2F41-4B81-8F12-6692A17A7B0E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1BDBABCC-3082-4258-91A8-107F67C9B3F4} + EndGlobalSection +EndGlobal diff --git a/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Class1.cs b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Class1.cs new file mode 100644 index 00000000..88090d44 --- /dev/null +++ b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Class1.cs @@ -0,0 +1,33 @@ +using Syncfusion.Pdf; +using Syncfusion.Presentation; +using Syncfusion.PresentationToPdfConverter; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Convert_PowerPoint_Presentation_to_PDF +{ + [ComVisible(true)] + [Guid("6F6B4A3C-5C98-4D63-8C7A-5B2C0F1D9E11")] // Use a unique GUID + [ProgId("Convert_PowerPoint_Presentation_to_PDF.Class1")] // Stable ProgID for VBScript + [ClassInterface(ClassInterfaceType.AutoDual)] + public class Class1 + { + public void ConvertPowerPointPresentationtoPDF(string inputFilePath, string outputFilePath) + { + using(IPresentation pptxDoc = Presentation.Open(inputFilePath)) + { + //Converts the PowerPoint Presentation into PDF document + using (PdfDocument pdfDocument = PresentationToPdfConverter.Convert(pptxDoc)) + { + // Save PDF document + pdfDocument.Save(outputFilePath); + } + } + } + } +} diff --git a/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Convert-PowerPoint-Presentation-to-PDF.csproj b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Convert-PowerPoint-Presentation-to-PDF.csproj new file mode 100644 index 00000000..42c71966 --- /dev/null +++ b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Convert-PowerPoint-Presentation-to-PDF.csproj @@ -0,0 +1,69 @@ + + + + + Debug + AnyCPU + {B38D2B86-2F41-4B81-8F12-6692A17A7B0E} + Library + Properties + Convert_PowerPoint_Presentation_to_PDF + Convert-PowerPoint-Presentation-to-PDF + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Syncfusion.Compression.Base.33.1.44\lib\net462\Syncfusion.Compression.Base.dll + + + ..\packages\Syncfusion.Licensing.33.1.44\lib\net462\Syncfusion.Licensing.dll + + + ..\packages\Syncfusion.OfficeChart.Base.33.1.44\lib\net462\Syncfusion.OfficeChart.Base.dll + + + ..\packages\Syncfusion.Pdf.WinForms.33.1.44\lib\net462\Syncfusion.Pdf.Base.dll + + + ..\packages\Syncfusion.Presentation.WinForms.33.1.44\lib\net462\Syncfusion.Presentation.Base.dll + + + ..\packages\Syncfusion.PresentationToPdfConverter.WinForms.33.1.44\lib\net462\Syncfusion.PresentationToPdfConverter.Base.dll + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Data/Output.pdf b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Data/Output.pdf new file mode 100644 index 00000000..cead1041 Binary files /dev/null and b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Data/Output.pdf differ diff --git a/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Data/Template.pptx b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Data/Template.pptx new file mode 100644 index 00000000..5746d9bf Binary files /dev/null and b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Data/Template.pptx differ diff --git a/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Properties/AssemblyInfo.cs b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..458cd5eb --- /dev/null +++ b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Convert-PowerPoint-Presentation-to-PDF")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Convert-PowerPoint-Presentation-to-PDF")] +[assembly: AssemblyCopyright("Copyright © 2026")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b38d2b86-2f41-4b81-8f12-6692a17a7b0e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/packages.config b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/packages.config new file mode 100644 index 00000000..56701d39 --- /dev/null +++ b/PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/COM-Interop/Convert-PowerPoint-Presentation-to-PDF/packages.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation-Script.vbs b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation-Script.vbs new file mode 100644 index 00000000..65949c19 --- /dev/null +++ b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation-Script.vbs @@ -0,0 +1,34 @@ +Option Explicit +On Error Resume Next + +' --- Change this input and output path as you want --- +Dim inputPath +inputPath = "D:\Template.pptx" + +Dim outputPath +outputPath = "D:\Output.pptx" + +' Create the COM object exposed by your .NET class +' ProgID must match the [ProgId] attribute in your C# class +Dim obj +Set obj = CreateObject("Open_and_Save_PowerPoint_Presentation.Class1") + +If Err.Number <> 0 Then + MsgBox "Failed to create COM object 'Open_and_Save_PowerPoint_Presentation.Class1'." & vbCrLf & _ + "Error " & Err.Number & ": " & Err.Description, vbCritical, "COM Error" + WScript.Quit 1 +End If + +' Call the method exposed by your class +obj.OpenAndSavePowerPointPresentation inputPath, outputPath + +If Err.Number <> 0 Then + MsgBox "Method call failed (OpenAndSavePowerPointPresentation)." & vbCrLf & _ + "Error " & Err.Number & ": " & Err.Description, vbCritical, "Invoke Error" + WScript.Quit 2 +End If + +' Release the COM object +Set obj = Nothing + +MsgBox "Success!" & vbCrLf & "Document created at:" & vbCrLf & outputPath, vbInformation, "Done" diff --git a/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation.sln b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation.sln new file mode 100644 index 00000000..12431a4e --- /dev/null +++ b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.37203.1 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Open-and-Save-PowerPoint-Presentation", "Open-and-Save-PowerPoint-Presentation\Open-and-Save-PowerPoint-Presentation.csproj", "{7A5A107C-3027-47CD-BB46-1638FAAECFC8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7A5A107C-3027-47CD-BB46-1638FAAECFC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A5A107C-3027-47CD-BB46-1638FAAECFC8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A5A107C-3027-47CD-BB46-1638FAAECFC8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A5A107C-3027-47CD-BB46-1638FAAECFC8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D969AC0D-2C7E-4CCE-A1B6-7A3AB628F78A} + EndGlobalSection +EndGlobal diff --git a/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Class1.cs b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Class1.cs new file mode 100644 index 00000000..a25e870e --- /dev/null +++ b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Class1.cs @@ -0,0 +1,35 @@ +using Syncfusion.Presentation; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Open_and_Save_PowerPoint_Presentation +{ + [ComVisible(true)] + [Guid("6F6B4A3C-5C98-4D63-8C7A-5B2C0F1D9E11")] // Use a unique GUID + [ProgId("Open_and_Save_PowerPoint_Presentation.Class1")] // Stable ProgID for VBScript + [ClassInterface(ClassInterfaceType.AutoDual)] + public class Class1 + { + public void OpenAndSavePowerPointPresentation(string inputFilePath, string outputFilePath) + { + // Open an existing PowerPoint presentation + using (IPresentation pptxDoc = Presentation.Open(inputFilePath)) + { + // Gets the first slide from the PowerPoint presentation + ISlide slide = pptxDoc.Slides[0]; + // Gets the first shape of the slide + IShape shape = slide.Shapes[0] as IShape; + // Change the text of the shape + if (shape.TextBody.Text == "Company History") + shape.TextBody.Text = "Company Profile"; + // Save the PowerPoint presentation + pptxDoc.Save(outputFilePath); + } + + } + } +} diff --git a/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Data/Output.pptx b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Data/Output.pptx new file mode 100644 index 00000000..d0cd9dbc Binary files /dev/null and b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Data/Output.pptx differ diff --git a/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Data/Template.pptx b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Data/Template.pptx new file mode 100644 index 00000000..5746d9bf Binary files /dev/null and b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Data/Template.pptx differ diff --git a/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Open-and-Save-PowerPoint-Presentation.csproj b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Open-and-Save-PowerPoint-Presentation.csproj new file mode 100644 index 00000000..00a9942e --- /dev/null +++ b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Open-and-Save-PowerPoint-Presentation.csproj @@ -0,0 +1,63 @@ + + + + + Debug + AnyCPU + {7A5A107C-3027-47CD-BB46-1638FAAECFC8} + Library + Properties + Open_and_Save_PowerPoint_Presentation + Open-and-Save-PowerPoint-Presentation + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Syncfusion.Compression.Base.33.1.44\lib\net462\Syncfusion.Compression.Base.dll + + + ..\packages\Syncfusion.Licensing.33.1.44\lib\net462\Syncfusion.Licensing.dll + + + ..\packages\Syncfusion.OfficeChart.Base.33.1.44\lib\net462\Syncfusion.OfficeChart.Base.dll + + + ..\packages\Syncfusion.Presentation.WinForms.33.1.44\lib\net462\Syncfusion.Presentation.Base.dll + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Properties/AssemblyInfo.cs b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..7400515a --- /dev/null +++ b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Open-and-Save-PowerPoint-Presentation")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Open-and-Save-PowerPoint-Presentation")] +[assembly: AssemblyCopyright("Copyright © 2026")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7a5a107c-3027-47cd-bb46-1638faaecfc8")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/packages.config b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/packages.config new file mode 100644 index 00000000..647d77ac --- /dev/null +++ b/Read-and-save-PowerPoint-presentation/Open-and-save-PowerPoint/COM-Interop/Open-and-Save-PowerPoint-Presentation/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file