Skip to content

Commit

Permalink
Merge branch 'ReleasePreparation'
Browse files Browse the repository at this point in the history
  • Loading branch information
vderyushev committed Sep 16, 2024
2 parents e9f8492 + 362be47 commit ebc6c80
Show file tree
Hide file tree
Showing 20 changed files with 320 additions and 207 deletions.
14 changes: 7 additions & 7 deletions Examples/ApiExamples/ApiExamples/ApiExamples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,16 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Aspose.BarCode" Version="24.7.0" />
<PackageReference Include="Aspose.Page" Version="24.7.0" />
<PackageReference Include="Aspose.PDF" Version="24.7.0" />
<PackageReference Include="Aspose.Words" Version="24.8.0" />
<PackageReference Include="Aspose.Words.Shaping.HarfBuzz" Version="24.8.0" />
<PackageReference Include="Aspose.BarCode" Version="24.8.0" />
<PackageReference Include="Aspose.Page" Version="24.8.0" />
<PackageReference Include="Aspose.PDF" Version="24.9.0" />
<PackageReference Include="Aspose.Words" Version="24.9.0" />
<PackageReference Include="Aspose.Words.Shaping.HarfBuzz" Version="24.9.0" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 0 additions & 2 deletions Examples/ApiExamples/ApiExamples/ExCharts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,6 @@ public void AxisDisplayUnit()
//ExFor:ChartAxis.MajorUnitScale
//ExFor:ChartAxis.MinorUnitIsAuto
//ExFor:ChartAxis.MinorUnitScale
//ExFor:ChartAxis.TickLabelSpacing
//ExFor:ChartAxis.TickLabelAlignment
//ExFor:AxisDisplayUnit
//ExFor:AxisDisplayUnit.CustomUnit
//ExFor:AxisDisplayUnit.Unit
Expand Down
6 changes: 3 additions & 3 deletions Examples/ApiExamples/ApiExamples/ExComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,18 @@ public void RemoveCommentReplies()
comment.AddReply("Joe Bloggs", "J.B.", DateTime.Now, "New reply");
comment.AddReply("Joe Bloggs", "J.B.", DateTime.Now, "Another reply");

Assert.AreEqual(2, comment.Replies.Count());
Assert.AreEqual(2, comment.Replies.Count);

// Below are two ways of removing replies from a comment.
// 1 - Use the "RemoveReply" method to remove replies from a comment individually:
comment.RemoveReply(comment.Replies[0]);

Assert.AreEqual(1, comment.Replies.Count());
Assert.AreEqual(1, comment.Replies.Count);

// 2 - Use the "RemoveAllReplies" method to remove all replies from a comment at once:
comment.RemoveAllReplies();

Assert.AreEqual(0, comment.Replies.Count());
Assert.AreEqual(0, comment.Replies.Count);
//ExEnd
}

Expand Down
17 changes: 17 additions & 0 deletions Examples/ApiExamples/ApiExamples/ExDigitalSignatureUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,22 @@ public void NoCertificateForSign()
Assert.Throws<ArgumentNullException>(
() => DigitalSignatureUtil.Sign(doc.OriginalFileName, outputFileName, null, signOptions));
}

[Test]
public void XmlDsig()
{
//ExStart:XmlDsig
//GistId:e06aa7a168b57907a5598e823a22bf0a
//ExFor:SignOptions.XmlDsigLevel
//ExFor:XmlDsigLevel
//ExSummary:Shows how to sign document based on XML-DSig standard.
CertificateHolder certificateHolder = CertificateHolder.Create(MyDir + "morzal.pfx", "aw");
SignOptions signOptions = new SignOptions { XmlDsigLevel = XmlDsigLevel.XAdEsEpes };

string inputFileName = MyDir + "Document.docx";
string outputFileName = ArtifactsDir + "DigitalSignatureUtil.XmlDsig.docx";
DigitalSignatureUtil.Sign(inputFileName, outputFileName, certificateHolder, signOptions);
//ExEnd:XmlDsig
}
}
}
4 changes: 2 additions & 2 deletions Examples/ApiExamples/ApiExamples/ExHtmlSaveOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ public void CssClassNamesPrefix()

outDocContents = File.ReadAllText(ArtifactsDir + "HtmlSaveOptions.CssClassNamePrefix.css");

Assert.True(outDocContents.Contains(".myprefix-Footer { margin-bottom:0pt; line-height:normal; font-family:Arial; font-size:11pt; -aw-style-name:footer }\r\n" +
".myprefix-Header { margin-bottom:0pt; line-height:normal; font-family:Arial; font-size:11pt; -aw-style-name:header }\r\n"));
Assert.True(outDocContents.Contains(".myprefix-Footer { margin-bottom:0pt; line-height:normal; font-family:Arial; font-size:11pt; -aw-style-name:footer }"));
Assert.True(outDocContents.Contains(".myprefix-Header { margin-bottom:0pt; line-height:normal; font-family:Arial; font-size:11pt; -aw-style-name:header }"));
//ExEnd
}

Expand Down
36 changes: 36 additions & 0 deletions Examples/ApiExamples/ApiExamples/ExInlineStory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -641,5 +641,41 @@ public void UpdateActualReferenceMarks()
Assert.AreEqual("1", footnote.ActualReferenceMark);
//ExEnd:UpdateActualReferenceMarks
}

[Test]
public void EndnoteSeparator()
{
//ExStart:EndnoteSeparator
//GistId:e06aa7a168b57907a5598e823a22bf0a
//ExFor:DocumentBase.FootnoteSeparators
//ExFor:FootnoteSeparatorType
//ExSummary:Shows how to remove endnote separator.
Document doc = new Document(MyDir + "Footnotes and endnotes.docx");

FootnoteSeparator endnoteSeparator = doc.FootnoteSeparators[FootnoteSeparatorType.EndnoteSeparator];
// Remove endnote separator.
endnoteSeparator.FirstParagraph.FirstChild.Remove();
//ExEnd:EndnoteSeparator

doc.Save(ArtifactsDir + "InlineStory.EndnoteSeparator.docx");
}

[Test]
public void FootnoteSeparator()
{
//ExStart:FootnoteSeparator
//GistId:e06aa7a168b57907a5598e823a22bf0a
//ExFor:DocumentBase.FootnoteSeparators
//ExFor:FootnoteSeparatorType
//ExSummary:Shows how to manage footnote separator format.
Document doc = new Document(MyDir + "Footnotes and endnotes.docx");

FootnoteSeparator footnoteSeparator = doc.FootnoteSeparators[FootnoteSeparatorType.FootnoteSeparator];
// Align footnote separator.
footnoteSeparator.FirstParagraph.ParagraphFormat.Alignment = ParagraphAlignment.Center;
//ExEnd:FootnoteSeparator

doc.Save(ArtifactsDir + "InlineStory.FootnoteSeparator.docx");
}
}
}
24 changes: 24 additions & 0 deletions Examples/ApiExamples/ApiExamples/ExMarkdownLoadOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,29 @@ public void PreserveEmptyLines()
}
//ExEnd:PreserveEmptyLines
}

[Test]
public void ImportUnderlineFormatting()
{
//ExStart:ImportUnderlineFormatting
//GistId:e06aa7a168b57907a5598e823a22bf0a
//ExFor:MarkdownLoadOptions.ImportUnderlineFormatting
//ExSummary:Shows how to recognize plus characters "++" as underline text formatting.
using (MemoryStream stream = new MemoryStream(Encoding.ASCII.GetBytes("++12 and B++")))
{
MarkdownLoadOptions loadOptions = new MarkdownLoadOptions() { ImportUnderlineFormatting = true };
Document doc = new Document(stream, loadOptions);

Paragraph para = (Paragraph)doc.GetChild(NodeType.Paragraph, 0, true);
Assert.AreEqual(Underline.Single, para.Runs[0].Font.Underline);

loadOptions = new MarkdownLoadOptions() { ImportUnderlineFormatting = false };
doc = new Document(stream, loadOptions);

para = (Paragraph)doc.GetChild(NodeType.Paragraph, 0, true);
Assert.AreEqual(Underline.None, para.Runs[0].Font.Underline);
}
//ExEnd:ImportUnderlineFormatting
}
}
}
37 changes: 37 additions & 0 deletions Examples/ApiExamples/ApiExamples/ExShape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3363,5 +3363,42 @@ public void CheckedCheckBox()
Assert.AreEqual(Forms2OleControlType.CheckBox, checkBoxControl.Type);
//ExEnd:CheckedCheckBox
}

[Test]
public void InsertGroupShape()
{
//ExStart:InsertGroupShape
//GistId:e06aa7a168b57907a5598e823a22bf0a
//ExFor:DocumentBuilder.InsertGroupShape(double, double, double, double, Shape[])
//ExFor:DocumentBuilder.InsertGroupShape(Shape[])
//ExSummary:Shows how to insert DML group shape.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Shape shape1 = builder.InsertShape(ShapeType.Rectangle, 200, 250);
shape1.Left = 20;
shape1.Top = 20;
shape1.Stroke.Color = Color.Red;

Shape shape2 = builder.InsertShape(ShapeType.Ellipse, 150, 200);
shape2.Left = 40;
shape2.Top = 50;
shape2.Stroke.Color = Color.Green;

// Dimensions for the new GroupShape node.
double left = 10;
double top = 10;
double width = 200;
double height = 300;
// Insert GroupShape node for the specified size which is inserted into the specified position.
GroupShape groupShape1 = builder.InsertGroupShape(left, top, width, height, new Shape[] { shape1, shape2 });

// Insert GroupShape node which position and dimension will be calculated automatically.
Shape shape3 = (Shape)shape1.Clone(true);
GroupShape groupShape2 = builder.InsertGroupShape(shape3);

doc.Save(ArtifactsDir + "Shape.InsertGroupShape.docx");
//ExEnd:InsertGroupShape
}
}
}
22 changes: 22 additions & 0 deletions Examples/ApiExamples/ApiExamples/ExStructuredDocumentTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1355,5 +1355,27 @@ public void Appearance()
tag.Appearance = SdtAppearance.Tags;
//ExEnd:Appearance
}

[Test]
public void InsertStructuredDocumentTag()
{
//ExStart:InsertStructuredDocumentTag
//GistId:e06aa7a168b57907a5598e823a22bf0a
//ExFor:DocumentBuilder.InsertStructuredDocumentTag(SdtType)
//ExSummary:Shows how to simply insert structured document tag.
Document doc = new Document(MyDir + "Rendering.docx");
DocumentBuilder builder = new DocumentBuilder(doc);

builder.MoveTo(doc.FirstSection.Body.Paragraphs[3]);
// Note, that only following StructuredDocumentTag types are allowed for insertion:
// SdtType.PlainText, SdtType.RichText, SdtType.Checkbox, SdtType.DropDownList,
// SdtType.ComboBox, SdtType.Picture, SdtType.Date.
// Markup level of inserted StructuredDocumentTag will be detected automatically and depends on position being inserted at.
// Added StructuredDocumentTag will inherit paragraph and font formatting from cursor position.
StructuredDocumentTag sdtPlain = builder.InsertStructuredDocumentTag(SdtType.PlainText);

doc.Save(ArtifactsDir + "StructuredDocumentTag.InsertStructuredDocumentTag.docx");
//ExEnd:InsertStructuredDocumentTag
}
}
}
42 changes: 38 additions & 4 deletions Examples/ApiExamples/ApiExamples/ExTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1705,10 +1705,10 @@ public void ConvertWithParagraphMark()

// Replace the table with the new paragraph
ConvertTable(table);

// Remove table after convertion.
table.Remove();

doc.Save(ArtifactsDir + "output.docx");
doc.Save(ArtifactsDir + "Table.ConvertWithParagraphMark.docx");
}

/// <summary>
Expand Down Expand Up @@ -1793,7 +1793,7 @@ private void ConvertWith(string separator, Table table)
// If the separator is a tab, calculate the tab stop position based on the width of the previous cell.
if (separator == ControlChar.Tab)
{
var previousCell = cell.PreviousCell;
Cell previousCell = cell.PreviousCell;
if (previousCell != null)
tabStopWidth += previousCell.CellFormat.Width;

Expand All @@ -1804,7 +1804,7 @@ private void ConvertWith(string separator, Table table)
}

// Clone and append all child nodes of the paragraph to the current paragraph.
var childNodes = paragraph.GetChildNodes(NodeType.Any, true);
NodeCollection childNodes = paragraph.GetChildNodes(NodeType.Any, true);
if (childNodes.Count > 0)
foreach (Node node in childNodes)
((Paragraph)currentPara).AppendChild(node.Clone(true));
Expand Down Expand Up @@ -1895,5 +1895,39 @@ private Cell CalculateColSpan(Cell cell, out int colSpan)
}
return cell;
}

[Test]
public void ContextTableFormatting()
{
//ExStart:ContextTableFormatting
//GistId:e06aa7a168b57907a5598e823a22bf0a
//ExFor:DocumentBuilderOptions
//ExFor:DocumentBuilderOptions.ContextTableFormatting
//ExSummary:Shows how to ignore table formatting for content after.
Document doc = new Document();
DocumentBuilderOptions builderOptions = new DocumentBuilderOptions();
builderOptions.ContextTableFormatting = true;
DocumentBuilder builder = new DocumentBuilder(doc, builderOptions);

// Adds content before the table.
// Default font size is 12.
builder.Writeln("Font size 12 here.");
builder.StartTable();
builder.InsertCell();
// Changes the font size inside the table.
builder.Font.Size = 5;
builder.Write("Font size 5 here");
builder.InsertCell();
builder.Write("Font size 5 here");
builder.EndRow();
builder.EndTable();

// If ContextTableFormatting is true, then table formatting isn't applied to the content after.
// If ContextTableFormatting is false, then table formatting is applied to the content after.
builder.Writeln("Font size 12 here.");

doc.Save(ArtifactsDir + "Table.ContextTableFormatting.docx");
//ExEnd:ContextTableFormatting
}
}
}
8 changes: 5 additions & 3 deletions Examples/ApiExamples/ApiExamples/ExXpsSaveOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,11 @@ public void XpsDigitalSignature()
Document doc = new Document(MyDir + "Document.docx");

CertificateHolder certificateHolder = CertificateHolder.Create(MyDir + "morzal.pfx", "aw");
DigitalSignatureDetails digitalSignatureDetails = new DigitalSignatureDetails(
certificateHolder,
new SignOptions() { Comments = "Some comments", SignTime = DateTime.Now });
SignOptions options = new SignOptions();
options.SignTime = DateTime.Now;
options.Comments = "Some comments";

DigitalSignatureDetails digitalSignatureDetails = new DigitalSignatureDetails(certificateHolder, options);

XpsSaveOptions saveOptions = new XpsSaveOptions();
saveOptions.DigitalSignatureDetails = digitalSignatureDetails;
Expand Down
12 changes: 6 additions & 6 deletions Examples/ApiExamples/Runner.MAUI/Runner.MAUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Aspose.Page" Version="24.7.0" />
<PackageReference Include="Aspose.PDF" Version="24.7.0" />
<PackageReference Include="Aspose.Words" Version="24.8.0" />
<PackageReference Include="Aspose.Words.Shaping.HarfBuzz" Version="24.8.0" />
<PackageReference Include="Aspose.Page" Version="24.8.0" />
<PackageReference Include="Aspose.PDF" Version="24.9.0" />
<PackageReference Include="Aspose.Words" Version="24.9.0" />
<PackageReference Include="Aspose.Words.Shaping.HarfBuzz" Version="24.9.0" />
<PackageReference Include="Shiny.Xunit.Runners.Maui" Version="1.0.0" />
<PackageReference Include="SkiaSharp" Version="2.88.8" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.Maui.Controls" Version="8.0.80" />
<PackageReference Update="Microsoft.Maui.Controls" Version="8.0.90" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.80" />
<PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.90" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Examples/DocsExamples/Docker/Docker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspose.Words" Version="24.8.0" />
<PackageReference Include="Aspose.Words" Version="24.9.0" />
</ItemGroup>

</Project>
12 changes: 6 additions & 6 deletions Examples/DocsExamples/DocsExamples/DocsExamples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Aspose.BarCode" Version="24.7.0" />
<PackageReference Include="Aspose.Email" Version="24.7.0" />
<PackageReference Include="Aspose.Words" Version="24.8.0" />
<PackageReference Include="Aspose.Words.Shaping.HarfBuzz" Version="24.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Aspose.BarCode" Version="24.8.0" />
<PackageReference Include="Aspose.Email" Version="24.8.0" />
<PackageReference Include="Aspose.Words" Version="24.9.0" />
<PackageReference Include="Aspose.Words.Shaping.HarfBuzz" Version="24.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="System.Data.OleDb" Version="8.0.0" />
</ItemGroup>

Expand Down
Loading

0 comments on commit ebc6c80

Please sign in to comment.