Skip to content

Commit 9693967

Browse files
author
Konduru Keerthi Konduru Ravichandra Raju
committed
Word to PDF conversion
1 parent 316f201 commit 9693967

File tree

273 files changed

+147732
-16095
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+147732
-16095
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
55
</startup>
6-
</configuration>
6+
</configuration>

Word-to-PDF-Conversion/Convert-Word-document-to-PDF/.NET-Framework/Convert-Word-document-to-PDF/Convert-Word-document-to-PDF.csproj

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
<OutputType>Exe</OutputType>
99
<RootNamespace>Convert_Word_document_to_PDF</RootNamespace>
1010
<AssemblyName>Convert-Word-document-to-PDF</AssemblyName>
11-
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
11+
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
1212
<FileAlignment>512</FileAlignment>
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1414
<Deterministic>true</Deterministic>
15+
<TargetFrameworkProfile />
1516
</PropertyGroup>
1617
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1718
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -33,29 +34,29 @@
3334
<WarningLevel>4</WarningLevel>
3435
</PropertyGroup>
3536
<ItemGroup>
36-
<Reference Include="Syncfusion.Compression.Base, Version=20.2460.0.48, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
37-
<HintPath>..\packages\Syncfusion.Compression.Base.20.2.0.48\lib\net46\Syncfusion.Compression.Base.dll</HintPath>
37+
<Reference Include="Syncfusion.Compression.Base, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
38+
<HintPath>..\packages\Syncfusion.Compression.Base.26.1.42\lib\net462\Syncfusion.Compression.Base.dll</HintPath>
3839
</Reference>
39-
<Reference Include="Syncfusion.DocIO.Base, Version=20.2460.0.48, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
40-
<HintPath>..\packages\Syncfusion.DocIO.WinForms.20.2.0.48\lib\net46\Syncfusion.DocIO.Base.dll</HintPath>
40+
<Reference Include="Syncfusion.DocIO.Base, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
41+
<HintPath>..\packages\Syncfusion.DocIO.WinForms.26.1.42\lib\net462\Syncfusion.DocIO.Base.dll</HintPath>
4142
</Reference>
42-
<Reference Include="Syncfusion.DocToPdfConverter.Base, Version=20.2460.0.48, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
43-
<HintPath>..\packages\Syncfusion.DocToPDFConverter.WinForms.20.2.0.48\lib\net46\Syncfusion.DocToPdfConverter.Base.dll</HintPath>
43+
<Reference Include="Syncfusion.DocToPdfConverter.Base, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
44+
<HintPath>..\packages\Syncfusion.DocToPDFConverter.WinForms.26.1.42\lib\net462\Syncfusion.DocToPdfConverter.Base.dll</HintPath>
4445
</Reference>
45-
<Reference Include="Syncfusion.Licensing, Version=20.2460.0.48, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
46-
<HintPath>..\packages\Syncfusion.Licensing.20.2.0.48\lib\net46\Syncfusion.Licensing.dll</HintPath>
46+
<Reference Include="Syncfusion.Licensing, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
47+
<HintPath>..\packages\Syncfusion.Licensing.26.1.42\lib\net462\Syncfusion.Licensing.dll</HintPath>
4748
</Reference>
48-
<Reference Include="Syncfusion.OfficeChart.Base, Version=20.2460.0.48, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
49-
<HintPath>..\packages\Syncfusion.OfficeChart.Base.20.2.0.48\lib\net46\Syncfusion.OfficeChart.Base.dll</HintPath>
49+
<Reference Include="Syncfusion.OfficeChart.Base, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
50+
<HintPath>..\packages\Syncfusion.OfficeChart.Base.26.1.42\lib\net462\Syncfusion.OfficeChart.Base.dll</HintPath>
5051
</Reference>
51-
<Reference Include="Syncfusion.OfficeChartToImageConverter.Wpf, Version=20.2460.0.48, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
52-
<HintPath>..\packages\Syncfusion.OfficeChartToImageConverter.WinForms.20.2.0.48\lib\net46\Syncfusion.OfficeChartToImageConverter.Wpf.dll</HintPath>
52+
<Reference Include="Syncfusion.OfficeChartToImageConverter.Wpf, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
53+
<HintPath>..\packages\Syncfusion.OfficeChartToImageConverter.WinForms.26.1.42\lib\net462\Syncfusion.OfficeChartToImageConverter.Wpf.dll</HintPath>
5354
</Reference>
54-
<Reference Include="Syncfusion.Pdf.Base, Version=20.2460.0.48, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
55-
<HintPath>..\packages\Syncfusion.Pdf.WinForms.20.2.0.48\lib\net46\Syncfusion.Pdf.Base.dll</HintPath>
55+
<Reference Include="Syncfusion.Pdf.Base, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
56+
<HintPath>..\packages\Syncfusion.Pdf.WinForms.26.1.42\lib\net462\Syncfusion.Pdf.Base.dll</HintPath>
5657
</Reference>
57-
<Reference Include="Syncfusion.SfChart.WPF, Version=20.2460.0.48, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
58-
<HintPath>..\packages\Syncfusion.SfChart.WPF.20.2.0.48\lib\net46\Syncfusion.SfChart.WPF.dll</HintPath>
58+
<Reference Include="Syncfusion.SfChart.WPF, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
59+
<HintPath>..\packages\Syncfusion.SfChart.WPF.26.1.42\lib\net462\Syncfusion.SfChart.WPF.dll</HintPath>
5960
</Reference>
6061
<Reference Include="System" />
6162
<Reference Include="System.Core" />
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Syncfusion.Compression.Base" version="20.2.0.48" targetFramework="net46" />
4-
<package id="Syncfusion.DocIO.WinForms" version="20.2.0.48" targetFramework="net46" />
5-
<package id="Syncfusion.DocToPDFConverter.WinForms" version="20.2.0.48" targetFramework="net46" />
6-
<package id="Syncfusion.Licensing" version="20.2.0.48" targetFramework="net46" />
7-
<package id="Syncfusion.OfficeChart.Base" version="20.2.0.48" targetFramework="net46" />
8-
<package id="Syncfusion.OfficeChartToImageConverter.WinForms" version="20.2.0.48" targetFramework="net46" />
9-
<package id="Syncfusion.Pdf.WinForms" version="20.2.0.48" targetFramework="net46" />
10-
<package id="Syncfusion.SfChart.WPF" version="20.2.0.48" targetFramework="net46" />
3+
<package id="Syncfusion.Compression.Base" version="26.1.42" targetFramework="net462" />
4+
<package id="Syncfusion.DocIO.WinForms" version="26.1.42" targetFramework="net462" />
5+
<package id="Syncfusion.DocToPDFConverter.WinForms" version="26.1.42" targetFramework="net462" />
6+
<package id="Syncfusion.Licensing" version="26.1.42" targetFramework="net462" />
7+
<package id="Syncfusion.OfficeChart.Base" version="26.1.42" targetFramework="net462" />
8+
<package id="Syncfusion.OfficeChartToImageConverter.WinForms" version="26.1.42" targetFramework="net462" />
9+
<package id="Syncfusion.Pdf.WinForms" version="26.1.42" targetFramework="net462" />
10+
<package id="Syncfusion.SfChart.WPF" version="26.1.42" targetFramework="net462" />
1111
</packages>
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
4-
VisualStudioVersion = 17.0.31611.283
4+
VisualStudioVersion = 17.10.34928.147
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Convert-Word-Document-to-PDF", "Convert-Word-Document-to-PDF\Convert-Word-Document-to-PDF.csproj", "{EAB41859-6648-4558-A654-3A8277F12296}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Convert-Word-Document-to-PDF", "Convert-Word-Document-to-PDF\Convert-Word-Document-to-PDF.csproj", "{0F71511F-7BDF-44D7-AA7C-3CFE39D08461}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{EAB41859-6648-4558-A654-3A8277F12296}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{EAB41859-6648-4558-A654-3A8277F12296}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{EAB41859-6648-4558-A654-3A8277F12296}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17-
{EAB41859-6648-4558-A654-3A8277F12296}.Release|Any CPU.ActiveCfg = Release|Any CPU
18-
{EAB41859-6648-4558-A654-3A8277F12296}.Release|Any CPU.Build.0 = Release|Any CPU
19-
{EAB41859-6648-4558-A654-3A8277F12296}.Release|Any CPU.Deploy.0 = Release|Any CPU
14+
{0F71511F-7BDF-44D7-AA7C-3CFE39D08461}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{0F71511F-7BDF-44D7-AA7C-3CFE39D08461}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{0F71511F-7BDF-44D7-AA7C-3CFE39D08461}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{0F71511F-7BDF-44D7-AA7C-3CFE39D08461}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{0F71511F-7BDF-44D7-AA7C-3CFE39D08461}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{0F71511F-7BDF-44D7-AA7C-3CFE39D08461}.Release|Any CPU.Deploy.0 = Release|Any CPU
2020
EndGlobalSection
2121
GlobalSection(SolutionProperties) = preSolution
2222
HideSolutionNode = FALSE
2323
EndGlobalSection
2424
GlobalSection(ExtensibilityGlobals) = postSolution
25-
SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
25+
SolutionGuid = {CD4F69EB-B162-43CB-B319-6703E9362881}
2626
EndGlobalSection
2727
EndGlobal
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
namespace Convert_Word_Document_to_PDF;
2-
3-
public partial class App : Application
1+
namespace Convert_Word_Document_to_PDF
42
{
5-
public App()
6-
{
7-
InitializeComponent();
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
88

9-
MainPage = new AppShell();
10-
}
9+
MainPage = new AppShell();
10+
}
11+
}
1112
}

Word-to-PDF-Conversion/Convert-Word-document-to-PDF/.NET-MAUI/Convert-Word-Document-to-PDF/AppShell.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
55
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
66
xmlns:local="clr-namespace:Convert_Word_Document_to_PDF"
7-
Shell.FlyoutBehavior="Disabled">
7+
Shell.FlyoutBehavior="Disabled"
8+
Title="Convert_Word_Document_to_PDF">
89

910
<ShellContent
1011
Title="Home"
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
namespace Convert_Word_Document_to_PDF;
2-
3-
public partial class AppShell : Shell
1+
namespace Convert_Word_Document_to_PDF
42
{
5-
public AppShell()
6-
{
7-
InitializeComponent();
8-
}
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
910
}
Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
66
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
7-
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
7+
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
8+
9+
<!-- Note for MacCatalyst:
10+
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
11+
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
12+
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
13+
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
14+
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
15+
816
<OutputType>Exe</OutputType>
917
<RootNamespace>Convert_Word_Document_to_PDF</RootNamespace>
1018
<UseMaui>true</UseMaui>
1119
<SingleProject>true</SingleProject>
1220
<ImplicitUsings>enable</ImplicitUsings>
21+
<Nullable>enable</Nullable>
1322

1423
<!-- Display name -->
1524
<ApplicationTitle>Convert-Word-Document-to-PDF</ApplicationTitle>
1625

1726
<!-- App Identifier -->
18-
<ApplicationId>com.companyname.convert_word_document_to_pdf</ApplicationId>
19-
<ApplicationIdGuid>53516326-D849-4739-821E-E0E58D4D1CEC</ApplicationIdGuid>
27+
<ApplicationId>com.companyname.convertworddocumenttopdf</ApplicationId>
2028

2129
<!-- Versions -->
2230
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
2331
<ApplicationVersion>1</ApplicationVersion>
2432

25-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
26-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
33+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
34+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
2735
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
2836
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
2937
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
@@ -39,7 +47,7 @@
3947

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

4452
<!-- Custom Fonts -->
4553
<MauiFont Include="Resources\Fonts\*" />
@@ -49,20 +57,18 @@
4957
</ItemGroup>
5058

5159
<ItemGroup>
52-
<AndroidResource Remove="Template\**" />
53-
<Compile Remove="Template\**" />
54-
<EmbeddedResource Remove="Template\**" />
55-
<MauiCss Remove="Template\**" />
56-
<MauiXaml Remove="Template\**" />
57-
<None Remove="Template\**" />
60+
<None Remove="Assets\Input.docx" />
5861
</ItemGroup>
5962

6063
<ItemGroup>
61-
<None Remove="Platforms\Android\Resources\xml\provider_paths.xml" />
64+
<EmbeddedResource Include="Assets\Input.docx" />
6265
</ItemGroup>
6366

6467
<ItemGroup>
65-
<PackageReference Include="Syncfusion.DocIORenderer.NET" Version="21.2.4" />
68+
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
69+
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
70+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
71+
<PackageReference Include="Syncfusion.DocIORenderer.NET" Version="*" />
6672
</ItemGroup>
6773

6874
</Project>

Word-to-PDF-Conversion/Convert-Word-document-to-PDF/.NET-MAUI/Convert-Word-Document-to-PDF/Convert-Word-Document-to-PDF.csproj.user

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-

1+
using Syncfusion.DocIO.DLS;
22
using Syncfusion.DocIO;
3-
using Syncfusion.DocIO.DLS;
43
using Syncfusion.DocIORenderer;
5-
using Syncfusion.Pdf;
64
using System.Reflection;
5+
using Syncfusion.Pdf;
76
using Convert_Word_Document_to_PDF.SaveServices;
87

9-
namespace Convert_Word_Document_to_PDF;
10-
11-
public partial class MainPage : ContentPage
8+
namespace Convert_Word_Document_to_PDF
129
{
13-
int count = 0;
10+
public partial class MainPage : ContentPage
11+
{
12+
int count = 0;
1413

15-
public MainPage()
16-
{
17-
InitializeComponent();
18-
}
14+
public MainPage()
15+
{
16+
InitializeComponent();
17+
}
1918

20-
private void ConvertWordtoPDF(object sender, EventArgs e)
21-
{
22-
//Loading an existing Word document
23-
Assembly assembly = typeof(App).GetTypeInfo().Assembly;
24-
using (WordDocument document = new WordDocument(assembly.GetManifestResourceStream("Convert_Word_Document_to_PDF.Assets.Input.docx"), FormatType.Docx))
19+
private void ConvertWordtoPDF(object sender, EventArgs e)
2520
{
26-
//Instantiation of DocIORenderer for Word to PDF conversion
27-
using (DocIORenderer render = new DocIORenderer())
21+
//Loading an existing Word document
22+
Assembly assembly = typeof(App).GetTypeInfo().Assembly;
23+
using (WordDocument document = new WordDocument(assembly.GetManifestResourceStream("Convert_Word_Document_to_PDF.Assets.Input.docx"), FormatType.Docx))
2824
{
29-
//Converts Word document into PDF document
30-
using (PdfDocument pdfDocument = render.ConvertToPDF(document))
25+
//Instantiation of DocIORenderer for Word to PDF conversion
26+
using (DocIORenderer render = new DocIORenderer())
3127
{
32-
//Saves the PDF document to MemoryStream.
33-
MemoryStream stream = new MemoryStream();
34-
pdfDocument.Save(stream);
28+
//Converts Word document into PDF document
29+
using (PdfDocument pdfDocument = render.ConvertToPDF(document))
30+
{
31+
//Saves the PDF document to MemoryStream.
32+
MemoryStream stream = new MemoryStream();
33+
pdfDocument.Save(stream);
3534

36-
//save and Launch the PDF document
37-
SaveService saveService = new();
38-
saveService.SaveAndView("Sample.pdf", "application/pdf", stream);
35+
//save and Launch the PDF document
36+
SaveService saveService = new();
37+
saveService.SaveAndView("Sample.pdf", "application/pdf", stream);
38+
}
3939
}
4040
}
4141
}
4242
}
43-
}
4443

44+
}

0 commit comments

Comments
 (0)