diff --git a/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces.slnx b/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces.slnx new file mode 100644 index 00000000..4d6cdff5 --- /dev/null +++ b/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces/Create-ink-with-multipletraces.csproj b/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces/Create-ink-with-multipletraces.csproj new file mode 100644 index 00000000..b9271e18 --- /dev/null +++ b/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces/Create-ink-with-multipletraces.csproj @@ -0,0 +1,24 @@ + + + + Exe + net8.0 + Create_ink_with_multipletraces + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces/Output/.gitkeep b/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces/Output/.gitkeep new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces/Output/.gitkeep @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces/Output/Result.docx b/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces/Output/Result.docx new file mode 100644 index 00000000..9f9a5cf4 Binary files /dev/null and b/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces/Output/Result.docx differ diff --git a/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces/Program.cs b/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces/Program.cs new file mode 100644 index 00000000..bd071dc6 --- /dev/null +++ b/Paragraphs/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces/Program.cs @@ -0,0 +1,86 @@ +using Syncfusion.DocIO; +using Syncfusion.DocIO.DLS; +using Syncfusion.Drawing; +using Syncfusion.Office; + +namespace Create_ink_with_multipletraces +{ + class Program + { + static void Main(string[] args) + { + //Creates a new Word document. + using (WordDocument document = new WordDocument()) + { + //Adds new section to the document. + IWSection section = document.AddSection(); + //Adds new paragraph to the section. + WParagraph paragraph = section.AddParagraph() as WParagraph; + //Adds new ink to the document. + WInk ink = paragraph.AppendInk(450, 350); + // Sets the horizontal position of the ink object. + ink.HorizontalPosition = 30; + // Sets the Vertical position of the ink object. + ink.VerticalPosition = 50; + // Sets the text wrapping style for the ink object to be in front of text. + ink.WrapFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText; + // Gets the ink traces collection from the ink object. + IOfficeInkTraces traces = ink.Traces; + // Gets all trace point arrays from the helper method. + List pointsCollection = GetPoints(); + // Adds each trace to the ink object. + foreach (var points in pointsCollection) + { + // Adds the trace to the ink object. + IOfficeInkTrace trace = traces.Add(points); + // Sets the brush color for the trace to red. + trace.Brush.Color = Color.Red; + // Sets the brush size for the ink stroke. + trace.Brush.Size = new SizeF(5f, 5f); + } + 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); + } + } + } + /// + /// A collection where each array represents a single stroke. + /// + static List GetPoints() + { + return new List + { + //Trace_i + new PointF[] { + new PointF(20f, 10f), + new PointF(20f, 140f), + }, + //Trace_n + new PointF[] + { + new PointF(60f, 80f), + new PointF(60f, 100f), + new PointF(60f, 140f), + new PointF(60f, 92f), + new PointF(70f, 86f), + new PointF(88f, 84f), + new PointF(100f, 92f), + new PointF(106f, 108f), + new PointF(110f, 140f) + }, + //Trace_k + new PointF[] { + new PointF(140f, 10f), + new PointF(140f, 140f), + new PointF(140f, 80f), + new PointF(180f, 20f), + new PointF(140f, 80f), + new PointF(180f, 140f) + } + }; + } + } +} + diff --git a/Paragraphs/Create-ink/.NET/Create-ink.slnx b/Paragraphs/Create-ink/.NET/Create-ink.slnx new file mode 100644 index 00000000..1399297c --- /dev/null +++ b/Paragraphs/Create-ink/.NET/Create-ink.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Paragraphs/Create-ink/.NET/Create-ink/Create-ink.csproj b/Paragraphs/Create-ink/.NET/Create-ink/Create-ink.csproj new file mode 100644 index 00000000..51152d54 --- /dev/null +++ b/Paragraphs/Create-ink/.NET/Create-ink/Create-ink.csproj @@ -0,0 +1,24 @@ + + + + Exe + net8.0 + Create_ink + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/Paragraphs/Create-ink/.NET/Create-ink/Output/.gitkeep b/Paragraphs/Create-ink/.NET/Create-ink/Output/.gitkeep new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/Paragraphs/Create-ink/.NET/Create-ink/Output/.gitkeep @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Paragraphs/Create-ink/.NET/Create-ink/Output/Result.docx b/Paragraphs/Create-ink/.NET/Create-ink/Output/Result.docx new file mode 100644 index 00000000..c9d9a994 Binary files /dev/null and b/Paragraphs/Create-ink/.NET/Create-ink/Output/Result.docx differ diff --git a/Paragraphs/Create-ink/.NET/Create-ink/Program.cs b/Paragraphs/Create-ink/.NET/Create-ink/Program.cs new file mode 100644 index 00000000..fbc88693 --- /dev/null +++ b/Paragraphs/Create-ink/.NET/Create-ink/Program.cs @@ -0,0 +1,46 @@ +using Syncfusion.DocIO; +using Syncfusion.DocIO.DLS; +using Syncfusion.Drawing; +using Syncfusion.Office; + +namespace Create_ink +{ + class Program + { + static void Main(string[] args) + { + //Creates a new Word document. + using (WordDocument document = new WordDocument()) + { + //Adds new section to the document. + IWSection section = document.AddSection(); + //Adds new paragraph to the section. + WParagraph paragraph = section.AddParagraph() as WParagraph; + //Adds new text to the paragraph + IWTextRange firstText = paragraph.AppendText("Created a triangle using Ink"); + //Apply formatting for first text range + firstText.CharacterFormat.FontSize = 14; + firstText.CharacterFormat.Bold = true; + //Adds new ink to the document. + WInk ink = paragraph.AppendInk(400, 300); + // Gets the ink traces collection from the ink object. + IOfficeInkTraces traces = ink.Traces; + // Adds new ink stroke with required trace points + PointF[] triangle = new PointF[] { new PointF(0f, 300f), new PointF(200f, 0f), new PointF(400f, 300f), new PointF(0f, 300f) }; + // Adds a new ink trace to the ink object using the triangle points. + IOfficeInkTrace trace = traces.Add(triangle); + // Modify the brush effects and size + IOfficeInkBrush brush = trace.Brush; + // Sets the brush size for the ink stroke. + brush.Size = new SizeF(5f, 5f); + // Sets the ink effect to 'Galaxy'. + brush.InkEffect = OfficeInkEffectType.Galaxy; + 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); + } + } + } + } +} diff --git a/Paragraphs/Modify-ink-color/.NET/Modify_ink_color.slnx b/Paragraphs/Modify-ink-color/.NET/Modify_ink_color.slnx new file mode 100644 index 00000000..4e7e7beb --- /dev/null +++ b/Paragraphs/Modify-ink-color/.NET/Modify_ink_color.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Data/Template.docx b/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Data/Template.docx new file mode 100644 index 00000000..e386241a Binary files /dev/null and b/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Data/Template.docx differ diff --git a/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Modify_ink_color.csproj b/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Modify_ink_color.csproj new file mode 100644 index 00000000..fc538475 --- /dev/null +++ b/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Modify_ink_color.csproj @@ -0,0 +1,26 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + + + Always + + + Always + + + Always + + + + diff --git a/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Output/.gitkeep b/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Output/.gitkeep new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Output/.gitkeep @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Output/Result.docx b/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Output/Result.docx new file mode 100644 index 00000000..613a71c7 Binary files /dev/null and b/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Output/Result.docx differ diff --git a/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Program.cs b/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Program.cs new file mode 100644 index 00000000..ed558b3e --- /dev/null +++ b/Paragraphs/Modify-ink-color/.NET/Modify_ink_color/Program.cs @@ -0,0 +1,34 @@ +using Syncfusion.DocIO; +using Syncfusion.DocIO.DLS; +using Syncfusion.Drawing; +using Syncfusion.Office; + +namespace Modify_ink_color +{ + class Program + { + static void Main(string[] args) + { + using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Template.docx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + //Creates a new Word document. + using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx)) + { + // Gets the first section of the document. + WSection section = document.Sections[0]; + // Access the ink and customize its color. + WInk ink = section.Paragraphs[0].ChildEntities[0] as WInk; + // Gets the ink trace from the ink object. + IOfficeInkTrace inkTrace = ink.Traces[0]; + // Modify the brush color to Color.Red. + inkTrace.Brush.Color = Color.Red; + 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/Modify-ink-effect/.NET/Modify-ink-effect.slnx b/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect.slnx new file mode 100644 index 00000000..d3194549 --- /dev/null +++ b/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Data/Template.docx b/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Data/Template.docx new file mode 100644 index 00000000..e6db1d1b Binary files /dev/null and b/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Data/Template.docx differ diff --git a/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Modify-ink-effect.csproj b/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Modify-ink-effect.csproj new file mode 100644 index 00000000..2973ec7c --- /dev/null +++ b/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Modify-ink-effect.csproj @@ -0,0 +1,27 @@ + + + + Exe + net8.0 + Modify_ink_effect + enable + enable + + + + + + + + + Always + + + Always + + + Always + + + + diff --git a/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Output/.gitkeep b/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Output/.gitkeep new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Output/.gitkeep @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Output/Result.docx b/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Output/Result.docx new file mode 100644 index 00000000..a42e24ac Binary files /dev/null and b/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Output/Result.docx differ diff --git a/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Program.cs b/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Program.cs new file mode 100644 index 00000000..16c151cf --- /dev/null +++ b/Paragraphs/Modify-ink-effect/.NET/Modify-ink-effect/Program.cs @@ -0,0 +1,34 @@ +using Syncfusion.DocIO; +using Syncfusion.DocIO.DLS; +using Syncfusion.Office; + +namespace Modify_ink_effect +{ + class Program + { + static void Main(string[] args) + { + using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Template.docx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + //Creates a new Word document. + using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx)) + { + // Gets the first section of the document. + WSection section = document.Sections[0]; + // Access the ink and customize its effect. + WInk ink = section.Paragraphs[1].ChildEntities[0] as WInk; + // Gets the ink trace from the ink object. + IOfficeInkTrace inkTrace = ink.Traces[0]; + // Modify the ink effect to 'Lava'. + inkTrace.Brush.InkEffect = OfficeInkEffectType.Lava; + // Creates a file stream to save the modified document. + 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); + } + } + } + } + } +} diff --git a/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points.slnx b/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points.slnx new file mode 100644 index 00000000..e5ac6c9d --- /dev/null +++ b/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Data/Template.docx b/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Data/Template.docx new file mode 100644 index 00000000..b6e39a4f Binary files /dev/null and b/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Data/Template.docx differ diff --git a/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Modify-ink-Points.csproj b/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Modify-ink-Points.csproj new file mode 100644 index 00000000..fb1916f8 --- /dev/null +++ b/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Modify-ink-Points.csproj @@ -0,0 +1,27 @@ + + + + Exe + net8.0 + Modify_ink_Points + enable + enable + + + + + + + + + Always + + + Always + + + Always + + + + diff --git a/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Output/.gitkeep b/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Output/.gitkeep new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Output/.gitkeep @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Output/Result.docx b/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Output/Result.docx new file mode 100644 index 00000000..6097100b Binary files /dev/null and b/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Output/Result.docx differ diff --git a/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Program.cs b/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Program.cs new file mode 100644 index 00000000..70c53b3e --- /dev/null +++ b/Paragraphs/Modify-ink-points/.NET/Modify-ink-Points/Program.cs @@ -0,0 +1,35 @@ +using Syncfusion.DocIO; +using Syncfusion.DocIO.DLS; +using Syncfusion.Drawing; +using Syncfusion.Office; + +namespace Modify_ink_points +{ + class Program + { + static void Main(string[] args) + { + using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Template.docx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + //Creates a new Word document. + using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx)) + { + // Gets the first section of the document. + WSection section = document.Sections[0]; + // Access the ink and customize its trace points. + WInk ink = section.Paragraphs[0].ChildEntities[0] as WInk; + // Gets the ink trace from the ink object. + IOfficeInkTrace inkTrace = ink.Traces[0]; + // Close the ink stroke by setting the last point to be the same as the first point + inkTrace.Points[inkTrace.Points.Length - 1] = new PointF(inkTrace.Points[0].X, inkTrace.Points[0].Y); + // Creates a file stream to save the modified document. + 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/Modify-ink-thickness/.NET/Modify-ink-thickness.slnx b/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness.slnx new file mode 100644 index 00000000..68d8ef66 --- /dev/null +++ b/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Data/Template.docx b/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Data/Template.docx new file mode 100644 index 00000000..e386241a Binary files /dev/null and b/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Data/Template.docx differ diff --git a/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Modify-ink-thickness.csproj b/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Modify-ink-thickness.csproj new file mode 100644 index 00000000..a085a68b --- /dev/null +++ b/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Modify-ink-thickness.csproj @@ -0,0 +1,27 @@ + + + + Exe + net8.0 + Modify_ink_thickness + enable + enable + + + + + + + + + Always + + + Always + + + Always + + + + diff --git a/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Output/.gitkeep b/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Output/.gitkeep new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Output/.gitkeep @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Output/Result.docx b/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Output/Result.docx new file mode 100644 index 00000000..43c42785 Binary files /dev/null and b/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Output/Result.docx differ diff --git a/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Program.cs b/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Program.cs new file mode 100644 index 00000000..67b2c28e --- /dev/null +++ b/Paragraphs/Modify-ink-thickness/.NET/Modify-ink-thickness/Program.cs @@ -0,0 +1,34 @@ +using Syncfusion.DocIO; +using Syncfusion.DocIO.DLS; +using Syncfusion.Drawing; +using Syncfusion.Office; + +namespace Modify_ink_thickness +{ + class Program + { + static void Main(string[] args) + { + using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Template.docx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + //Creates a new Word document. + using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx)) + { + // Gets the first section of the document. + WSection section = document.Sections[0]; + // Access the ink and customize its trace size. + WInk ink = section.Paragraphs[0].ChildEntities[0] as WInk; + // Gets the ink trace from the ink object. + IOfficeInkTrace inkTrace = ink.Traces[0]; + // Modify the ink size (thickness) to 1 point. + inkTrace.Brush.Size = new SizeF(1f, 1f); + 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); + } + } + } + } + } +} diff --git a/Paragraphs/Remove-ink/.NET/Remove_ink.slnx b/Paragraphs/Remove-ink/.NET/Remove_ink.slnx new file mode 100644 index 00000000..40851ec5 --- /dev/null +++ b/Paragraphs/Remove-ink/.NET/Remove_ink.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Paragraphs/Remove-ink/.NET/Remove_ink/Data/Template.docx b/Paragraphs/Remove-ink/.NET/Remove_ink/Data/Template.docx new file mode 100644 index 00000000..e386241a Binary files /dev/null and b/Paragraphs/Remove-ink/.NET/Remove_ink/Data/Template.docx differ diff --git a/Paragraphs/Remove-ink/.NET/Remove_ink/Output/.gitkeep b/Paragraphs/Remove-ink/.NET/Remove_ink/Output/.gitkeep new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/Paragraphs/Remove-ink/.NET/Remove_ink/Output/.gitkeep @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Paragraphs/Remove-ink/.NET/Remove_ink/Output/Result.docx b/Paragraphs/Remove-ink/.NET/Remove_ink/Output/Result.docx new file mode 100644 index 00000000..d0d5580b Binary files /dev/null and b/Paragraphs/Remove-ink/.NET/Remove_ink/Output/Result.docx differ diff --git a/Paragraphs/Remove-ink/.NET/Remove_ink/Program.cs b/Paragraphs/Remove-ink/.NET/Remove_ink/Program.cs new file mode 100644 index 00000000..4bef47d0 --- /dev/null +++ b/Paragraphs/Remove-ink/.NET/Remove_ink/Program.cs @@ -0,0 +1,37 @@ +using Syncfusion.DocIO; +using Syncfusion.DocIO.DLS; +using Syncfusion.Office; + +namespace Create_ink +{ + class Program + { + static void Main(string[] args) + { + using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Template.docx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + //Creates a new Word document. + using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx)) + { + //Get the ink paragraph of the document. + WParagraph paragraph = document.Sections[0].Paragraphs[0]; + //Iterates through the child elements of ink paragraph. + for (int i = 0; i < paragraph.ChildEntities.Count; i++) + { + //Removes the ink from the paragraph. + if (paragraph.ChildEntities[i] is WInk) + { + paragraph.Items.RemoveAt(i); + i--; + } + } + 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); + } + } + } + } + } +} diff --git a/Paragraphs/Remove-ink/.NET/Remove_ink/Remove_ink.csproj b/Paragraphs/Remove-ink/.NET/Remove_ink/Remove_ink.csproj new file mode 100644 index 00000000..fc538475 --- /dev/null +++ b/Paragraphs/Remove-ink/.NET/Remove_ink/Remove_ink.csproj @@ -0,0 +1,26 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + + + Always + + + Always + + + Always + + + +