Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Bookmarks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Charts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Comments/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Compare-Word-documents/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Content-Controls/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions FAQs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Fields/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Find-and-Replace/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Find-item-in-word-document/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Footnotes-and-Endnotes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Form-Fields/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Getting-Started/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions HTML-conversions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Macros/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Mail-Merge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Markdown-to-Word-conversion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Mathematical-Equation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Paragraphs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions RTF-conversions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Read-and-Save-document/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Sections/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Security/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Shapes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions SmartArts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Table-Of-Contents/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Tables/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Text-file-conversion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Track-Changes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Watermark/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Word-document/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Word-file-formats/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Word-to-EPUB-conversion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Word-to-Image-conversion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.12.35527.113 d17.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Set-custom-image-resolution", "Set-custom-image-resolution\Set-custom-image-resolution.csproj", "{5B0540C8-1A4D-4BB4-A0B9-10028D140E00}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5B0540C8-1A4D-4BB4-A0B9-10028D140E00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B0540C8-1A4D-4BB4-A0B9-10028D140E00}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B0540C8-1A4D-4BB4-A0B9-10028D140E00}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B0540C8-1A4D-4BB4-A0B9-10028D140E00}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using Syncfusion.DocIO;
using Syncfusion.DocIO.DLS;
using Syncfusion.DocIORenderer;
using System.Drawing;
using System.Drawing.Imaging;


// Open the input Word document stream in read mode
using (FileStream docStream = new FileStream(Path.GetFullPath(@"Data/Template.docx"), FileMode.Open, FileAccess.Read))
{
// Load the Word document using Syncfusion DocIO
using (WordDocument document = new WordDocument(docStream, FormatType.Automatic))
{
// Create an instance of DocIORenderer to render the Word document as images
using (DocIORenderer render = new DocIORenderer())
{
// Convert all pages of the Word document to image streams
Stream[] imageStreams = document.RenderAsImages();

// Iterate through each image stream (one per page)
for (int i = 0; i < imageStreams.Length; i++)
{
// Reset the stream position to the beginning
imageStreams[i].Position = 0;

// Define custom dimensions for the output image
int customWidth = 1500;
int customHeight = 1500;

// Load the image from stream
Image image = Image.FromStream(imageStreams[i]);

// Save the image to a new memory stream in PNG format
MemoryStream stream = new MemoryStream();
image.Save(stream, ImageFormat.Png);

// Create a new bitmap with custom size and pixel format
Bitmap bitmap = new Bitmap(customWidth, customHeight, PixelFormat.Format32bppPArgb);

// Create graphics object to draw on the bitmap
Graphics graphics = Graphics.FromImage(bitmap);

// Set bitmap resolution to 300 DPI
bitmap.SetResolution(300, 300);

// Draw the resized image onto the custom-sized bitmap
graphics.DrawImage(Image.FromStream(stream), new Rectangle(0, 0, bitmap.Width, bitmap.Height));

// Save the final bitmap image to output folder
bitmap.Save(Path.GetFullPath(@"Output/Image_" + i + ".png"));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Set_custom_image_resolution</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Data\Template.docx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Output\.gitkeep">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions Word-to-Markdown-conversion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Word-to-ODT-conversion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
3 changes: 3 additions & 0 deletions Word-to-PDF-Conversion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Note:**

If you get a "DirectoryNotFoundException" error, it may be due to a long file path. Shorten the path or move the sample to a folder with a shorter path and try again.
Loading