Skip to content

Commit a911f21

Browse files
Added Sample
1 parent 1e63487 commit a911f21

File tree

5 files changed

+71
-0
lines changed

5 files changed

+71
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36518.9 d17.14
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Resize_Images_to_fit_Owner_Element", "Resize_Images_to_fit_Owner_Element\Resize_Images_to_fit_Owner_Element.csproj", "{B86AC942-C5FE-4288-B63D-9A371371FE5D}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{B86AC942-C5FE-4288-B63D-9A371371FE5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{B86AC942-C5FE-4288-B63D-9A371371FE5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{B86AC942-C5FE-4288-B63D-9A371371FE5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{B86AC942-C5FE-4288-B63D-9A371371FE5D}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {DDC2C844-5ECF-4167-929E-7BD09AD37F20}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using Syncfusion.DocIO;
2+
using Syncfusion.DocIO.DLS;
3+
4+
namespace Resize_Images_to_fit_Owner_Element
5+
{
6+
internal class Program
7+
{
8+
static void Main(string[] args)
9+
{
10+
// Create a new Word document instance
11+
WordDocument document = new WordDocument();
12+
// Enable automatic image resizing
13+
document.Settings.ResizeImageToFitInContainer = true;
14+
// Open the template document
15+
document.Open(Path.GetFullPath(@"Data/InputDocument.docx"), FormatType.Docx);
16+
// Save the modified document
17+
document.Save(Path.GetFullPath(@"Output/Result.docx"), FormatType.Docx);
18+
// Release resources
19+
document.Dispose();
20+
}
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<RootNamespace>Resize_Images_to_fit_Owner_Element</RootNamespace>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="*" />
13+
</ItemGroup>
14+
<ItemGroup>
15+
<None Update="Data\InputDocument.docx">
16+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
17+
</None>
18+
<None Update="Output\.gitkeep">
19+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
20+
</None>
21+
</ItemGroup>
22+
23+
</Project>

0 commit comments

Comments
 (0)