Skip to content

Commit

Permalink
Merge branch 'ReleasePreparation'
Browse files Browse the repository at this point in the history
  • Loading branch information
vderyushev committed Oct 14, 2024
2 parents ebc6c80 + 5a441e7 commit ab07f02
Show file tree
Hide file tree
Showing 14 changed files with 249 additions and 80 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,21 +125,21 @@
</ItemGroup>

<ItemGroup>
<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="Aspose.BarCode" Version="24.9.0" />
<PackageReference Include="Aspose.Page" Version="24.9.0" />
<PackageReference Include="Aspose.PDF" Version="24.10.0" />
<PackageReference Include="Aspose.Words" Version="24.10.0" />
<PackageReference Include="Aspose.Words.Shaping.HarfBuzz" Version="24.10.0" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="SkiaSharp" Version="2.88.8" />
<PackageReference Include="System.Data.OleDb" Version="8.0.0" />
<PackageReference Include="System.Data.OleDb" Version="8.0.1" />
<PackageReference Include="System.IO.Compression" Version="4.3.0" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
</ItemGroup>
Expand Down
55 changes: 55 additions & 0 deletions Examples/ApiExamples/ApiExamples/ExCharts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2243,5 +2243,60 @@ public void TickLabelsOrientationRotation()
doc.Save(ArtifactsDir + "Charts.TickLabelsOrientationRotation.docx");
//ExEnd:TickLabelsOrientationRotation
}

[Test]
public void DoughnutChart()
{
//ExStart:DoughnutChart
//GistId:bb594993b5fe48692541e16f4d354ac2
//ExFor:ChartSeriesGroup.DoughnutHoleSize
//ExFor:ChartSeriesGroup.FirstSliceAngle
//ExSummary:Shows how to create and format Doughnut chart.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Shape shape = builder.InsertChart(ChartType.Doughnut, 400, 400);
Chart chart = shape.Chart;
// Delete the default generated series.
chart.Series.Clear();

string[] categories = new string[] { "Category 1", "Category 2", "Category 3" };
chart.Series.Add("Series 1", categories, new double[] { 4, 2, 5 });

// Format the Doughnut chart.
ChartSeriesGroup seriesGroup = chart.SeriesGroups[0];
seriesGroup.DoughnutHoleSize = 10;
seriesGroup.FirstSliceAngle = 270;

doc.Save(ArtifactsDir + "Charts.DoughnutChart.docx");
//ExEnd:DoughnutChart
}

[Test]
public void PieOfPieChart()
{
//ExStart:PieOfPieChart
//GistId:bb594993b5fe48692541e16f4d354ac2
//ExFor:ChartSeriesGroup.SecondSectionSize
//ExSummary:Shows how to create and format pie of Pie chart.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Shape shape = builder.InsertChart(ChartType.PieOfPie, 440, 300);
Chart chart = shape.Chart;
// Delete the default generated series.
chart.Series.Clear();

string[] categories = new string[] { "Category 1", "Category 2", "Category 3", "Category 4" };
chart.Series.Add("Series 1", categories, new double[] { 11, 8, 4, 3 });

// Format the Pie of Pie chart.
ChartSeriesGroup seriesGroup = chart.SeriesGroups[0];
seriesGroup.GapWidth = 10;
seriesGroup.SecondSectionSize = 77;

doc.Save(ArtifactsDir + "Charts.PieOfPieChart.docx");
//ExEnd:PieOfPieChart
}
}
}
12 changes: 6 additions & 6 deletions Examples/ApiExamples/ApiExamples/ExHtmlSaveOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -868,24 +868,24 @@ public void EpubHeadings()
//ExEnd

TestUtil.DocPackageFileContainsString("<navLabel><text>Heading #1</text></navLabel>",
ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "HtmlSaveOptions.EpubHeadings.ncx");
ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "toc.ncx");
TestUtil.DocPackageFileContainsString("<navLabel><text>Heading #2</text></navLabel>",
ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "HtmlSaveOptions.EpubHeadings.ncx");
ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "toc.ncx");
TestUtil.DocPackageFileContainsString("<navLabel><text>Heading #4</text></navLabel>",
ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "HtmlSaveOptions.EpubHeadings.ncx");
ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "toc.ncx");
TestUtil.DocPackageFileContainsString("<navLabel><text>Heading #5</text></navLabel>",
ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "HtmlSaveOptions.EpubHeadings.ncx");
ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "toc.ncx");

Assert.Throws<AssertionException>(() =>
{
TestUtil.DocPackageFileContainsString("<navLabel><text>Heading #3</text></navLabel>",
ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "HtmlSaveOptions.EpubHeadings.ncx");
ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "toc.ncx");
});

Assert.Throws<AssertionException>(() =>
{
TestUtil.DocPackageFileContainsString("<navLabel><text>Heading #6</text></navLabel>",
ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "HtmlSaveOptions.EpubHeadings.ncx");
ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "toc.ncx");
});
}

Expand Down
36 changes: 36 additions & 0 deletions Examples/ApiExamples/ApiExamples/ExMarkdownSaveOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,42 @@ public void LinkExportMode()
string outDocContents = File.ReadAllText(ArtifactsDir + "MarkdownSaveOptions.LinkExportMode.Inline.md");
Assert.AreEqual("![](MarkdownSaveOptions.LinkExportMode.Inline.001.png)", outDocContents.Trim());
}

[Test]
public void ExportTableAsHtml()
{
//ExStart:ExportTableAsHtml
//GistId:bb594993b5fe48692541e16f4d354ac2
//ExFor:MarkdownExportAsHtml
//ExFor:MarkdownSaveOptions.ExportAsHtml
//ExSummary:Shows how to export a table to Markdown as raw HTML.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.Writeln("Sample table:");

// Create table.
builder.InsertCell();
builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;
builder.Write("Cell1");
builder.InsertCell();
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
builder.Write("Cell2");

MarkdownSaveOptions saveOptions = new MarkdownSaveOptions();
saveOptions.ExportAsHtml = MarkdownExportAsHtml.Tables;

doc.Save(ArtifactsDir + "MarkdownSaveOptions.ExportTableAsHtml.md", saveOptions);
//ExEnd:ExportTableAsHtml

string outDocContents = File.ReadAllText(ArtifactsDir + "MarkdownSaveOptions.ExportTableAsHtml.md");
Assert.AreEqual("Sample table:\r\n<table cellspacing=\"0\" cellpadding=\"0\" style=\"width:100%; border:0.75pt solid #000000; border-collapse:collapse\">" +
"<tr><td style=\"border-right-style:solid; border-right-width:0.75pt; padding-right:5.03pt; padding-left:5.03pt; vertical-align:top\">" +
"<p style=\"margin-top:0pt; margin-bottom:0pt; text-align:right; font-size:12pt\"><span style=\"font-family:'Times New Roman'\">Cell1</span></p>" +
"</td><td style=\"border-left-style:solid; border-left-width:0.75pt; padding-right:5.03pt; padding-left:5.03pt; vertical-align:top\">" +
"<p style=\"margin-top:0pt; margin-bottom:0pt; text-align:center; font-size:12pt\"><span style=\"font-family:'Times New Roman'\">Cell2</span></p>" +
"</td></tr></table>", outDocContents.Trim());
}
}
}

2 changes: 1 addition & 1 deletion Examples/ApiExamples/ApiExamples/ExPdfSaveOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ public void UsePdfDocumentForCompliance(PdfCompliance pdfCompliance)
Assert.AreEqual("2.0", pdfDocument.Version);
break;
case PdfCompliance.PdfA4:
Assert.AreEqual(PdfFormat.v_2_0, pdfDocument.PdfFormat);
Assert.AreEqual(PdfFormat.PDF_A_4, pdfDocument.PdfFormat);
Assert.AreEqual("2.0", pdfDocument.Version);
break;
case PdfCompliance.PdfA4Ua2:
Expand Down
68 changes: 66 additions & 2 deletions Examples/ApiExamples/ApiExamples/ExShape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3369,8 +3369,8 @@ public void InsertGroupShape()
{
//ExStart:InsertGroupShape
//GistId:e06aa7a168b57907a5598e823a22bf0a
//ExFor:DocumentBuilder.InsertGroupShape(double, double, double, double, Shape[])
//ExFor:DocumentBuilder.InsertGroupShape(Shape[])
//ExFor:DocumentBuilder.InsertGroupShape(double, double, double, double, ShapeBase[])
//ExFor:DocumentBuilder.InsertGroupShape(ShapeBase[])
//ExSummary:Shows how to insert DML group shape.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Expand Down Expand Up @@ -3400,5 +3400,69 @@ public void InsertGroupShape()
doc.Save(ArtifactsDir + "Shape.InsertGroupShape.docx");
//ExEnd:InsertGroupShape
}

[Test]
public void CombineGroupShape()
{
//ExStart:CombineGroupShape
//GistId:bb594993b5fe48692541e16f4d354ac2
//ExFor:DocumentBuilder.InsertGroupShape(ShapeBase[])
//ExSummary:Shows how to combine group shape with the 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;

// Combine shapes into a GroupShape node which is inserted into the specified position.
GroupShape groupShape1 = builder.InsertGroupShape(shape1, shape2);

// Combine Shape and GroupShape nodes.
Shape shape3 = (Shape)shape1.Clone(true);
GroupShape groupShape2 = builder.InsertGroupShape(groupShape1, shape3);

doc.Save(ArtifactsDir + "Shape.CombineGroupShape.docx");
//ExEnd:CombineGroupShape
}

[Test]
public void InsertCommandButton()
{
//ExStart:InsertCommandButton
//GistId:bb594993b5fe48692541e16f4d354ac2
//ExFor:CommandButtonControl
//ExFor:DocumentBuilder.InsertForms2OleControl(Forms2OleControl)
//ExSummary:Shows how to insert ActiveX control.
DocumentBuilder builder = new DocumentBuilder();

CommandButtonControl button1 = new CommandButtonControl();
Shape shape = builder.InsertForms2OleControl(button1);
Assert.AreEqual(Forms2OleControlType.CommandButton, ((Forms2OleControl)shape.OleFormat.OleControl).Type);
//ExEnd:InsertCommandButton
}

[Test]
public void Hidden()
{
//ExStart:Hidden
//GistId:bb594993b5fe48692541e16f4d354ac2
//ExFor:ShapeBase.Hidden
//ExSummary:Shows how to hide the shape.
Document doc = new Document(MyDir + "Shadow color.docx");

Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);
if (!shape.Hidden)
shape.Hidden = true;

doc.Save(ArtifactsDir + "Shape.Hidden.docx");
//ExEnd:Hidden
}
}
}
28 changes: 14 additions & 14 deletions Examples/ApiExamples/Runner.MAUI/ExCharts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ public void AxisProperties()
xAxis.MinorTickMark = AxisTickMark.Cross;
xAxis.MajorUnit = 10.0d;
xAxis.MinorUnit = 15.0d;
xAxis.TickLabelOffset = 50;
xAxis.TickLabelPosition = AxisTickLabelPosition.Low;
xAxis.TickLabelSpacingIsAuto = false;
xAxis.TickLabels.Offset = 50;
xAxis.TickLabels.Position = AxisTickLabelPosition.Low;
xAxis.TickLabels.IsAutoSpacing = false;
xAxis.TickMarkSpacing = 1;

ChartAxis yAxis = chart.AxisY;
Expand All @@ -204,7 +204,7 @@ public void AxisProperties()
yAxis.MinorTickMark = AxisTickMark.Cross;
yAxis.MajorUnit = 100.0d;
yAxis.MinorUnit = 20.0d;
yAxis.TickLabelPosition = AxisTickLabelPosition.NextToAxis;
yAxis.TickLabels.Position = AxisTickLabelPosition.NextToAxis;

// Column charts do not have a Z-axis.
Assert.Null(chart.AxisZ);
Expand All @@ -222,9 +222,9 @@ public void AxisProperties()
Assert.Equal(AxisTickMark.Cross, chart.AxisX.MinorTickMark);
Assert.Equal(1.0d, chart.AxisX.MajorUnit);
Assert.Equal(0.5d, chart.AxisX.MinorUnit);
Assert.Equal(50, chart.AxisX.TickLabelOffset);
Assert.Equal(AxisTickLabelPosition.Low, chart.AxisX.TickLabelPosition);
Assert.False(chart.AxisX.TickLabelSpacingIsAuto);
Assert.Equal(50, chart.AxisX.TickLabels.Offset);
Assert.Equal(AxisTickLabelPosition.Low, chart.AxisX.TickLabels.Position);
Assert.False(chart.AxisX.TickLabels.IsAutoSpacing);
Assert.Equal(1, chart.AxisX.TickMarkSpacing);

Assert.Equal(AxisCategoryType.Category, chart.AxisY.CategoryType);
Expand All @@ -234,7 +234,7 @@ public void AxisProperties()
Assert.Equal(AxisTickMark.Cross, chart.AxisY.MinorTickMark);
Assert.Equal(100.0d, chart.AxisY.MajorUnit);
Assert.Equal(20.0d, chart.AxisY.MinorUnit);
Assert.Equal(AxisTickLabelPosition.NextToAxis, chart.AxisY.TickLabelPosition);
Assert.Equal(AxisTickLabelPosition.NextToAxis, chart.AxisY.TickLabels.Position);
}

[Fact]
Expand Down Expand Up @@ -285,7 +285,7 @@ public void DateTimeValues()

// Define Y-axis properties for decimal values.
ChartAxis yAxis = chart.AxisY;
yAxis.TickLabelPosition = AxisTickLabelPosition.High;
yAxis.TickLabels.Position = AxisTickLabelPosition.High;
yAxis.MajorUnit = 100.0d;
yAxis.MinorUnit = 50.0d;
yAxis.DisplayUnit.Unit = AxisBuiltInUnit.Hundreds;
Expand All @@ -306,7 +306,7 @@ public void DateTimeValues()
Assert.Equal(AxisTickMark.Cross, chart.AxisX.MajorTickMark);
Assert.Equal(AxisTickMark.Outside, chart.AxisX.MinorTickMark);

Assert.Equal(AxisTickLabelPosition.High, chart.AxisY.TickLabelPosition);
Assert.Equal(AxisTickLabelPosition.High, chart.AxisY.TickLabels.Position);
Assert.Equal(100.0d, chart.AxisY.MajorUnit);
Assert.Equal(50.0d, chart.AxisY.MinorUnit);
Assert.Equal(AxisBuiltInUnit.Hundreds, chart.AxisY.DisplayUnit.Unit);
Expand Down Expand Up @@ -1170,9 +1170,9 @@ public void AxisDisplayUnit()
// Set the X-axis bounds so that the X-axis spans 5 major tick marks and 12 minor tick marks.
axis.Scaling.Minimum = new AxisBound(-10);
axis.Scaling.Maximum = new AxisBound(30);
axis.TickLabelAlignment = ParagraphAlignment.Right;
axis.TickLabels.Alignment = ParagraphAlignment.Right;

Assert.Equal(1, axis.TickLabelSpacing);
Assert.Equal(1, axis.TickLabels.Spacing);

// Set the tick labels to display their value in millions.
axis.DisplayUnit.Unit = AxisBuiltInUnit.Millions;
Expand All @@ -1198,8 +1198,8 @@ public void AxisDisplayUnit()
Assert.Equal(10.0d, axis.MajorUnit);
Assert.Equal(-10.0d, axis.Scaling.Minimum.Value);
Assert.Equal(30.0d, axis.Scaling.Maximum.Value);
Assert.Equal(1, axis.TickLabelSpacing);
Assert.Equal(ParagraphAlignment.Right, axis.TickLabelAlignment);
Assert.Equal(1, axis.TickLabels.Spacing);
Assert.Equal(ParagraphAlignment.Right, axis.TickLabels.Alignment);
Assert.Equal(AxisBuiltInUnit.Custom, axis.DisplayUnit.Unit);
Assert.Equal(1000000.0d, axis.DisplayUnit.CustomUnit);

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.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="Aspose.Page" Version="24.9.0" />
<PackageReference Include="Aspose.PDF" Version="24.10.0" />
<PackageReference Include="Aspose.Words" Version="24.10.0" />
<PackageReference Include="Aspose.Words.Shaping.HarfBuzz" Version="24.10.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.90" />
<PackageReference Update="Microsoft.Maui.Controls" Version="8.0.91" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.90" />
<PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.91" />
</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.9.0" />
<PackageReference Include="Aspose.Words" Version="24.10.0" />
</ItemGroup>

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

<ItemGroup>
<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="Aspose.BarCode" Version="24.9.0" />
<PackageReference Include="Aspose.Email" Version="24.9.0" />
<PackageReference Include="Aspose.Words" Version="24.10.0" />
<PackageReference Include="Aspose.Words.Shaping.HarfBuzz" Version="24.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="System.Data.OleDb" Version="8.0.0" />
<PackageReference Include="System.Data.OleDb" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit ab07f02

Please sign in to comment.