Skip to content

Commit

Permalink
PPTX to PDF conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
KonduruKeerthi committed Jul 28, 2024
1 parent 90a71eb commit c903150
Show file tree
Hide file tree
Showing 210 changed files with 92,260 additions and 7,334 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
</configuration>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
<OutputType>Exe</OutputType>
<RootNamespace>Convert_PowerPoint_presentation_to_PDF</RootNamespace>
<AssemblyName>Convert-PowerPoint-presentation-to-PDF</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -33,23 +34,23 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Syncfusion.Compression.Base, Version=23.1460.44.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.Compression.Base.23.1.44\lib\net46\Syncfusion.Compression.Base.dll</HintPath>
<Reference Include="Syncfusion.Compression.Base, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.Compression.Base.26.1.42\lib\net462\Syncfusion.Compression.Base.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Licensing, Version=23.1460.44.0, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.Licensing.23.1.44\lib\net46\Syncfusion.Licensing.dll</HintPath>
<Reference Include="Syncfusion.Licensing, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.Licensing.26.1.42\lib\net462\Syncfusion.Licensing.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.OfficeChart.Base, Version=23.1460.44.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.OfficeChart.Base.23.1.44\lib\net46\Syncfusion.OfficeChart.Base.dll</HintPath>
<Reference Include="Syncfusion.OfficeChart.Base, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.OfficeChart.Base.26.1.42\lib\net462\Syncfusion.OfficeChart.Base.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Pdf.Base, Version=23.1460.44.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.Pdf.WinForms.23.1.44\lib\net46\Syncfusion.Pdf.Base.dll</HintPath>
<Reference Include="Syncfusion.Pdf.Base, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.Pdf.WinForms.26.1.42\lib\net462\Syncfusion.Pdf.Base.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Presentation.Base, Version=23.1460.44.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.Presentation.WinForms.23.1.44\lib\net46\Syncfusion.Presentation.Base.dll</HintPath>
<Reference Include="Syncfusion.Presentation.Base, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.Presentation.WinForms.26.1.42\lib\net462\Syncfusion.Presentation.Base.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.PresentationToPdfConverter.Base, Version=23.1460.44.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.PresentationToPdfConverter.WinForms.23.1.44\lib\net46\Syncfusion.PresentationToPdfConverter.Base.dll</HintPath>
<Reference Include="Syncfusion.PresentationToPdfConverter.Base, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.PresentationToPdfConverter.WinForms.26.1.42\lib\net462\Syncfusion.PresentationToPdfConverter.Base.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Syncfusion.Compression.Base" version="23.1.44" targetFramework="net46" />
<package id="Syncfusion.Licensing" version="23.1.44" targetFramework="net46" />
<package id="Syncfusion.OfficeChart.Base" version="23.1.44" targetFramework="net46" />
<package id="Syncfusion.Pdf.WinForms" version="23.1.44" targetFramework="net46" />
<package id="Syncfusion.Presentation.WinForms" version="23.1.44" targetFramework="net46" />
<package id="Syncfusion.PresentationToPdfConverter.WinForms" version="23.1.44" targetFramework="net46" />
<package id="Syncfusion.Compression.Base" version="26.1.42" targetFramework="net462" />
<package id="Syncfusion.Licensing" version="26.1.42" targetFramework="net462" />
<package id="Syncfusion.OfficeChart.Base" version="26.1.42" targetFramework="net462" />
<package id="Syncfusion.Pdf.WinForms" version="26.1.42" targetFramework="net462" />
<package id="Syncfusion.Presentation.WinForms" version="26.1.42" targetFramework="net462" />
<package id="Syncfusion.PresentationToPdfConverter.WinForms" version="26.1.42" targetFramework="net462" />
</packages>
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31611.283
VisualStudioVersion = 17.10.34928.147
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Convert-PowerPoint-Presentation-to-PDF", "Convert-PowerPoint-Presentation-to-PDF\Convert-PowerPoint-Presentation-to-PDF.csproj", "{DC3283BF-B613-48D7-9B82-1B8A41ED48AA}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Convert-PowerPoint-Presentation-to-PDF", "Convert-PowerPoint-Presentation-to-PDF\Convert-PowerPoint-Presentation-to-PDF.csproj", "{B94B46BE-166E-4B17-9F14-F67F74CBB24E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DC3283BF-B613-48D7-9B82-1B8A41ED48AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC3283BF-B613-48D7-9B82-1B8A41ED48AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC3283BF-B613-48D7-9B82-1B8A41ED48AA}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{DC3283BF-B613-48D7-9B82-1B8A41ED48AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC3283BF-B613-48D7-9B82-1B8A41ED48AA}.Release|Any CPU.Build.0 = Release|Any CPU
{DC3283BF-B613-48D7-9B82-1B8A41ED48AA}.Release|Any CPU.Deploy.0 = Release|Any CPU
{B94B46BE-166E-4B17-9F14-F67F74CBB24E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B94B46BE-166E-4B17-9F14-F67F74CBB24E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B94B46BE-166E-4B17-9F14-F67F74CBB24E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{B94B46BE-166E-4B17-9F14-F67F74CBB24E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B94B46BE-166E-4B17-9F14-F67F74CBB24E}.Release|Any CPU.Build.0 = Release|Any CPU
{B94B46BE-166E-4B17-9F14-F67F74CBB24E}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
SolutionGuid = {368BCEC6-9301-4C6E-A49F-F81D0D968F49}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
namespace Convert_PowerPoint_Presentation_to_PDF;

public partial class App : Application
namespace Convert_PowerPoint_Presentation_to_PDF
{
public App()
{
InitializeComponent();
public partial class App : Application
{
public App()
{
InitializeComponent();

MainPage = new AppShell();
}
MainPage = new AppShell();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Convert_PowerPoint_Presentation_to_PDF"
Shell.FlyoutBehavior="Disabled">
Shell.FlyoutBehavior="Disabled"
Title="Convert_PowerPoint_Presentation_to_PDF">

<ShellContent
Title="Home"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
namespace Convert_PowerPoint_Presentation_to_PDF;

public partial class AppShell : Shell
namespace Convert_PowerPoint_Presentation_to_PDF
{
public AppShell()
{
InitializeComponent();
}
public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->

<!-- Note for MacCatalyst:
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->

<OutputType>Exe</OutputType>
<RootNamespace>Convert_PowerPoint_Presentation_to_PDF</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<!-- Display name -->
<ApplicationTitle>Convert-PowerPoint-Presentation-to-PDF</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>com.companyname.convert_powerpoint_presentation_to_pdf</ApplicationId>
<ApplicationIdGuid>fea8b7ef-8927-4708-b772-dec9b09b21d1</ApplicationIdGuid>
<ApplicationId>com.companyname.convertpowerpointpresentationtopdf</ApplicationId>

<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
Expand All @@ -39,7 +47,7 @@

<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />

<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
Expand All @@ -48,18 +56,21 @@
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<None Remove="Assets\Input.pptx" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Assets\Input.pptx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.PresentationRenderer.NET" Version="*" />
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Syncfusion.PresentationRenderer.NET" Version="*" />
</ItemGroup>

<ItemGroup>
<Folder Include="Platforms\Android\Resources\xml\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

<ScrollView>
<Grid RowSpacing="25" RowDefinitions="Auto,Auto,Auto,Auto,*"
Padding="{OnPlatform iOS='30,60,30,30', Default='30'}">
Padding="{OnPlatform iOS='30,60,30,30', Default='30'}">
<Button
Text="Convert PPTX to PDF"
FontAttributes="Bold"
Grid.Row="0"
SemanticProperties.Hint="Convert PPTX to PDF"
Clicked="ConvertPPTXtoPDF"
HorizontalOptions="Center" />
Text="Convert PPTX to PDF"
FontAttributes="Bold"
Grid.Row="0"
SemanticProperties.Hint="Convert PPTX to PDF"
Clicked="ConvertPPTXtoPDF"
HorizontalOptions="Center" />
</Grid>
</ScrollView>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,37 @@
using System.Reflection;
using Convert_PowerPoint_Presentation_to_PDF.SaveServices;

namespace Convert_PowerPoint_Presentation_to_PDF;

public partial class MainPage : ContentPage
namespace Convert_PowerPoint_Presentation_to_PDF
{
int count = 0;
public partial class MainPage : ContentPage
{
int count = 0;

public MainPage()
{
InitializeComponent();
}
public MainPage()
{
InitializeComponent();
}

private void ConvertPPTXtoPDF(object sender, EventArgs e)
{
//Loading an existing PowerPoint presentation
Assembly assembly = typeof(App).GetTypeInfo().Assembly;
//Open the existing PowerPoint presentation with loaded stream.
using (IPresentation pptxDoc = Presentation.Open(assembly.GetManifestResourceStream("Convert_PowerPoint_Presentation_to_PDF.Assets.Input.pptx")))
private void ConvertPPTXtoPDF(object sender, EventArgs e)
{
//Convert the PowerPoint document to PDF document.
using (PdfDocument pdfDocument = PresentationToPdfConverter.Convert(pptxDoc))
//Loading an existing PowerPoint presentation
Assembly assembly = typeof(App).GetTypeInfo().Assembly;
//Open the existing PowerPoint presentation with loaded stream.
using (IPresentation pptxDoc = Presentation.Open(assembly.GetManifestResourceStream("Convert_PowerPoint_Presentation_to_PDF.Assets.Input.pptx")))
{
//Save the converted PDF document to MemoryStream.
MemoryStream pdfStream = new MemoryStream();
pdfDocument.Save(pdfStream);
pdfStream.Position = 0;
//save and Launch the PDF document
SaveService saveService = new();
saveService.SaveAndView("Sample.pdf", "application/pdf", pdfStream);
//Convert the PowerPoint document to PDF document.
using (PdfDocument pdfDocument = PresentationToPdfConverter.Convert(pptxDoc))
{
//Save the converted PDF document to MemoryStream.
MemoryStream pdfStream = new MemoryStream();
pdfDocument.Save(pdfStream);
pdfStream.Position = 0;
//save and Launch the PDF document
SaveService saveService = new();
saveService.SaveAndView("Sample.pdf", "application/pdf", pdfStream);
}
}
}
}
}

}
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
namespace Convert_PowerPoint_Presentation_to_PDF;
using Microsoft.Extensions.Logging;

public static class MauiProgram
namespace Convert_PowerPoint_Presentation_to_PDF
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});

return builder.Build();
}
#if DEBUG
builder.Logging.AddDebug();
#endif

return builder.Build();
}
}
}
Loading

0 comments on commit c903150

Please sign in to comment.