diff --git a/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element.sln b/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element.sln new file mode 100644 index 00000000..c333202a --- /dev/null +++ b/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36518.9 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +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}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B86AC942-C5FE-4288-B63D-9A371371FE5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B86AC942-C5FE-4288-B63D-9A371371FE5D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B86AC942-C5FE-4288-B63D-9A371371FE5D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B86AC942-C5FE-4288-B63D-9A371371FE5D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DDC2C844-5ECF-4167-929E-7BD09AD37F20} + EndGlobalSection +EndGlobal diff --git a/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element/Data/InputDocument.docx b/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element/Data/InputDocument.docx new file mode 100644 index 00000000..836e377e Binary files /dev/null and b/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element/Data/InputDocument.docx differ diff --git a/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element/Output/gitkeep.txt b/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element/Output/gitkeep.txt new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element/Output/gitkeep.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element/Program.cs b/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element/Program.cs new file mode 100644 index 00000000..1e57612e --- /dev/null +++ b/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element/Program.cs @@ -0,0 +1,29 @@ +using Syncfusion.DocIO; +using Syncfusion.DocIO.DLS; + +namespace Resize_Images_to_fit_Owner_Element +{ + internal class Program + { + static void Main(string[] args) + { + // Create a new Word document + using (WordDocument document = new WordDocument()) + { + // Enable automatic image resizing + document.Settings.ResizeImageToFitInContainer = true; + // Open the template document + using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/InputDocument.docx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + document.Open(fileStreamPath, FormatType.Automatic); + } + //Creates file stream. + using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Result.docx"), FileMode.Create, FileAccess.ReadWrite)) + { + //Saves the Word document to file stream. + document.Save(outputFileStream, FormatType.Docx); + } + } + } + } +} \ No newline at end of file diff --git a/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element/Resize_Images_to_fit_Owner_Element.csproj b/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element/Resize_Images_to_fit_Owner_Element.csproj new file mode 100644 index 00000000..037567ac --- /dev/null +++ b/Paragraphs/Resize_Images_to_fit_Owner_Element/.NET/Resize_Images_to_fit_Owner_Element/Resize_Images_to_fit_Owner_Element.csproj @@ -0,0 +1,23 @@ + + + + Exe + net8.0 + Resize_Images_to_fit_Owner_Element + enable + enable + + + + + + + + Always + + + Always + + + +