Skip to content

Commit 9bee4c7

Browse files
author
Konduru Keerthi Konduru Ravichandra Raju
committed
Read and Save document
1 parent 6df0315 commit 9bee4c7

File tree

245 files changed

+118597
-24607
lines changed

Some content is hidden

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

245 files changed

+118597
-24607
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>

Read-and-Save-document/Open-and-save-Word-document/.NET-Framework/Open-and-save-Word-document/Open-and-save-Word-document.csproj

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
<OutputType>Exe</OutputType>
99
<RootNamespace>Open_and_save_Word_document</RootNamespace>
1010
<AssemblyName>Open-and-save-Word-document</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,17 +34,17 @@
3334
<WarningLevel>4</WarningLevel>
3435
</PropertyGroup>
3536
<ItemGroup>
36-
<Reference Include="Syncfusion.Compression.Base, Version=19.4460.0.43, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
37-
<HintPath>..\packages\Syncfusion.Compression.Base.19.4.0.43\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=19.4460.0.43, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
40-
<HintPath>..\packages\Syncfusion.DocIO.WinForms.19.4.0.43\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.Licensing, Version=19.4460.0.43, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
43-
<HintPath>..\packages\Syncfusion.Licensing.19.4.0.43\lib\net46\Syncfusion.Licensing.dll</HintPath>
43+
<Reference Include="Syncfusion.Licensing, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
44+
<HintPath>..\packages\Syncfusion.Licensing.26.1.42\lib\net462\Syncfusion.Licensing.dll</HintPath>
4445
</Reference>
45-
<Reference Include="Syncfusion.OfficeChart.Base, Version=19.4460.0.43, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
46-
<HintPath>..\packages\Syncfusion.OfficeChart.Base.19.4.0.43\lib\net46\Syncfusion.OfficeChart.Base.dll</HintPath>
46+
<Reference Include="Syncfusion.OfficeChart.Base, Version=26.1462.42.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
47+
<HintPath>..\packages\Syncfusion.OfficeChart.Base.26.1.42\lib\net462\Syncfusion.OfficeChart.Base.dll</HintPath>
4748
</Reference>
4849
<Reference Include="System" />
4950
<Reference Include="System.Core" />
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Syncfusion.Compression.Base" version="19.4.0.43" targetFramework="net46" />
4-
<package id="Syncfusion.DocIO.WinForms" version="19.4.0.43" targetFramework="net46" />
5-
<package id="Syncfusion.Licensing" version="19.4.0.43" targetFramework="net46" />
6-
<package id="Syncfusion.OfficeChart.Base" version="19.4.0.43" 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.Licensing" version="26.1.42" targetFramework="net462" />
6+
<package id="Syncfusion.OfficeChart.Base" version="26.1.42" targetFramework="net462" />
77
</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}") = "Open-and-save-Word-document", "Open-and-save-Word-document\Open-and-save-Word-document.csproj", "{D99598FA-2B0E-4CD2-A527-C671378160F7}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Open-and-save-Word-document", "Open-and-save-Word-document\Open-and-save-Word-document.csproj", "{A9249AB7-ACE4-4E00-818B-91B0893CFDC1}"
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-
{D99598FA-2B0E-4CD2-A527-C671378160F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{D99598FA-2B0E-4CD2-A527-C671378160F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{D99598FA-2B0E-4CD2-A527-C671378160F7}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17-
{D99598FA-2B0E-4CD2-A527-C671378160F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
18-
{D99598FA-2B0E-4CD2-A527-C671378160F7}.Release|Any CPU.Build.0 = Release|Any CPU
19-
{D99598FA-2B0E-4CD2-A527-C671378160F7}.Release|Any CPU.Deploy.0 = Release|Any CPU
14+
{A9249AB7-ACE4-4E00-818B-91B0893CFDC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{A9249AB7-ACE4-4E00-818B-91B0893CFDC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{A9249AB7-ACE4-4E00-818B-91B0893CFDC1}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{A9249AB7-ACE4-4E00-818B-91B0893CFDC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{A9249AB7-ACE4-4E00-818B-91B0893CFDC1}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{A9249AB7-ACE4-4E00-818B-91B0893CFDC1}.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 = {7E55106C-BFD3-4D6B-B421-C594B9768DF9}
2626
EndGlobalSection
2727
EndGlobal
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
namespace Open_and_save_Word_document;
2-
3-
public partial class App : Application
1+
namespace Open_and_save_Word_document
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
}

Read-and-Save-document/Open-and-save-Word-document/.NET-MAUI/Open-and-save-Word-document/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:Open_and_save_Word_document"
7-
Shell.FlyoutBehavior="Disabled">
7+
Shell.FlyoutBehavior="Disabled"
8+
Title="Open_and_save_Word_document">
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 Open_and_save_Word_document;
2-
3-
public partial class AppShell : Shell
1+
namespace Open_and_save_Word_document
42
{
5-
public AppShell()
6-
{
7-
InitializeComponent();
8-
}
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
910
}

Read-and-Save-document/Open-and-save-Word-document/.NET-MAUI/Open-and-save-Word-document/MainPage.xaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
<ScrollView>
77
<Grid RowSpacing="25" RowDefinitions="Auto,Auto,Auto,Auto,*"
8-
Padding="{OnPlatform iOS='30,60,30,30', Default='30'}">
8+
Padding="{OnPlatform iOS='30,60,30,30', Default='30'}">
99
<Button
10-
Text="Open and Save Document"
11-
FontAttributes="Bold"
12-
Grid.Row="0"
13-
SemanticProperties.Hint="Open and Save Word document you click"
14-
Clicked="OpenAndSaveDocument"
15-
HorizontalOptions="Center" />
10+
Text="Open and Save Document"
11+
FontAttributes="Bold"
12+
Grid.Row="0"
13+
SemanticProperties.Hint="Open and Save Word document you click"
14+
Clicked="OpenAndSaveDocument"
15+
HorizontalOptions="Center" />
1616
</Grid>
1717
</ScrollView>
1818

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
1-
using Open_and_save_Word_document.SaveServices;
1+
using Syncfusion.DocIO.DLS;
22
using Syncfusion.DocIO;
3-
using Syncfusion.DocIO.DLS;
4-
using System.IO;
53
using System.Reflection;
4+
using Open_and_save_Word_document.SaveServices;
65

7-
namespace Open_and_save_Word_document;
8-
9-
public partial class MainPage : ContentPage
6+
namespace Open_and_save_Word_document
107
{
11-
int count = 0;
8+
public partial class MainPage : ContentPage
9+
{
10+
int count = 0;
1211

13-
public MainPage()
14-
{
15-
InitializeComponent();
16-
}
12+
public MainPage()
13+
{
14+
InitializeComponent();
15+
}
1716

18-
private void OpenAndSaveDocument(object sender, EventArgs e)
19-
{
20-
//Load an existing Word document.
21-
Assembly assembly = typeof(App).GetTypeInfo().Assembly;
22-
using (WordDocument document = new WordDocument(assembly.GetManifestResourceStream("Open_and_save_Word_document.Resources.Input.docx"),FormatType.Docx))
17+
private void OpenAndSaveDocument(object sender, EventArgs e)
2318
{
24-
//Access the section in a Word document.
25-
IWSection section = document.Sections[0];
26-
//Add a new paragraph to the section.
27-
IWParagraph paragraph = section.AddParagraph();
28-
paragraph.ParagraphFormat.FirstLineIndent = 36;
29-
paragraph.BreakCharacterFormat.FontSize = 12f;
30-
IWTextRange text = paragraph.AppendText("In 2000, Adventure Works Cycles bought a small manufacturing plant, Importadores Neptuno, located in Mexico. Importadores Neptuno manufactures several critical subcomponents for the Adventure Works Cycles product line. These subcomponents are shipped to the Bothell location for final product assembly. In 2001, Importadores Neptuno, became the sole manufacturer and distributor of the touring bicycle product group.");
31-
text.CharacterFormat.FontSize = 12f;
32-
//Saves the Word document to the memory stream.
33-
using MemoryStream ms = new();
34-
document.Save(ms, FormatType.Docx);
35-
ms.Position = 0;
36-
//Save the memory stream as a file.
37-
SaveService saveService = new();
38-
saveService.SaveAndView("Sample.docx", "application/msword", ms);
19+
//Load an existing Word document.
20+
Assembly assembly = typeof(App).GetTypeInfo().Assembly;
21+
using (WordDocument document = new WordDocument(assembly.GetManifestResourceStream("Open_and_save_Word_document.Resources.Input.docx"), FormatType.Docx))
22+
{
23+
//Access the section in a Word document.
24+
IWSection section = document.Sections[0];
25+
//Add a new paragraph to the section.
26+
IWParagraph paragraph = section.AddParagraph();
27+
paragraph.ParagraphFormat.FirstLineIndent = 36;
28+
paragraph.BreakCharacterFormat.FontSize = 12f;
29+
IWTextRange text = paragraph.AppendText("In 2000, Adventure Works Cycles bought a small manufacturing plant, Importadores Neptuno, located in Mexico. Importadores Neptuno manufactures several critical subcomponents for the Adventure Works Cycles product line. These subcomponents are shipped to the Bothell location for final product assembly. In 2001, Importadores Neptuno, became the sole manufacturer and distributor of the touring bicycle product group.");
30+
text.CharacterFormat.FontSize = 12f;
31+
//Saves the Word document to the memory stream.
32+
using MemoryStream ms = new();
33+
document.Save(ms, FormatType.Docx);
34+
ms.Position = 0;
35+
//Save the memory stream as a file.
36+
SaveService saveService = new();
37+
saveService.SaveAndView("Sample.docx", "application/msword", ms);
38+
}
3939
}
4040
}
41-
}
4241

42+
}
Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1-
namespace Open_and_save_Word_document;
1+
using Microsoft.Extensions.Logging;
22

3-
public static class MauiProgram
3+
namespace Open_and_save_Word_document
44
{
5-
public static MauiApp CreateMauiApp()
6-
{
7-
var builder = MauiApp.CreateBuilder();
8-
builder
9-
.UseMauiApp<App>()
10-
.ConfigureFonts(fonts =>
11-
{
12-
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
13-
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
14-
});
5+
public static class MauiProgram
6+
{
7+
public static MauiApp CreateMauiApp()
8+
{
9+
var builder = MauiApp.CreateBuilder();
10+
builder
11+
.UseMauiApp<App>()
12+
.ConfigureFonts(fonts =>
13+
{
14+
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
15+
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
16+
});
1517

16-
return builder.Build();
17-
}
18+
#if DEBUG
19+
builder.Logging.AddDebug();
20+
#endif
21+
22+
return builder.Build();
23+
}
24+
}
1825
}

0 commit comments

Comments
 (0)