diff --git a/Examples/ApiExamples/ApiExamples/CustomBarcodeGenerator.cs b/Examples/ApiExamples/ApiExamples/CustomBarcodeGenerator.cs
index bd36ec90f..2175b85a0 100644
--- a/Examples/ApiExamples/ApiExamples/CustomBarcodeGenerator.cs
+++ b/Examples/ApiExamples/ApiExamples/CustomBarcodeGenerator.cs
@@ -176,7 +176,7 @@ public Image GetBarcodeImage(BarcodeParameters parameters)
generator.Parameters.AutoSizeMode = AutoSizeMode.None;
}
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
return generator.GenerateBarCodeImage();
#elif NET5_0_OR_GREATER
generator.GenerateBarCodeImage().Save(ArtifactsDir + "GetBarcodeImage.png");
@@ -200,7 +200,7 @@ public Image GetOldBarcodeImage(BarcodeParameters parameters)
};
// Hardcode type for old-fashioned Barcode
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
return generator.GenerateBarCodeImage();
#elif NET5_0_OR_GREATER
generator.GenerateBarCodeImage().Save(ArtifactsDir + "OldBarcodeImage.png");
diff --git a/Examples/ApiExamples/ApiExamples/ExCharts.cs b/Examples/ApiExamples/ApiExamples/ExCharts.cs
index 95f4c57e7..34739845d 100644
--- a/Examples/ApiExamples/ApiExamples/ExCharts.cs
+++ b/Examples/ApiExamples/ApiExamples/ExCharts.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2001-2023 Aspose Pty Ltd. All Rights Reserved.
+// Copyright (c) 2001-2023 Aspose Pty Ltd. All Rights Reserved.
//
// This file is part of Aspose.Words. The source code in this file
// is only intended as a supplement to the documentation, and is provided
@@ -1280,7 +1280,6 @@ public void LegendEntries()
//ExFor:ChartLegendEntryCollection
//ExFor:ChartLegend.LegendEntries
//ExFor:ChartLegendEntry.IsHidden
- //ExFor:ChartLegendEntry.Font
//ExSummary:Shows how to work with a legend entry for chart series.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
@@ -1301,15 +1300,32 @@ public void LegendEntries()
ChartLegendEntryCollection legendEntries = chart.Legend.LegendEntries;
legendEntries[3].IsHidden = true;
- foreach (ChartLegendEntry legendEntry in legendEntries)
- legendEntry.Font.Size = 12;
-
- series1.LegendEntry.Font.Italic = true;
-
doc.Save(ArtifactsDir + "Charts.LegendEntries.docx");
//ExEnd
}
+ [Test]
+ public void LegendFont()
+ {
+ //ExStart:LegendFont
+ //ReleaseVersion:23.11
+ //ExFor:ChartLegendEntry.Font
+ //ExFor:ChartLegend.Font
+ //ExSummary:Shows how to work with a legend font.
+ Document doc = new Document(MyDir + "Reporting engine template - Chart series.docx");
+ Chart chart = ((Shape)doc.GetChild(NodeType.Shape, 0, true)).Chart;
+
+ ChartLegend chartLegend = chart.Legend;
+ // Set default font size all legend entries.
+ chartLegend.Font.Size = 14;
+ // Change font for specific legend entry.
+ chartLegend.LegendEntries[1].Font.Italic = true;
+ chartLegend.LegendEntries[1].Font.Size = 12;
+
+ doc.Save(ArtifactsDir + "Charts.LegendFont.docx");
+ //ExEnd:LegendFont
+ }
+
[Test]
public void RemoveSpecificChartSeries()
{
diff --git a/Examples/ApiExamples/ApiExamples/ExDocument.cs b/Examples/ApiExamples/ApiExamples/ExDocument.cs
index b9cdecf59..6f8231018 100644
--- a/Examples/ApiExamples/ApiExamples/ExDocument.cs
+++ b/Examples/ApiExamples/ApiExamples/ExDocument.cs
@@ -173,7 +173,7 @@ public void SaveToImageStream()
builder.InsertImage(ImageDir + "Logo.jpg");
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
using (MemoryStream stream = new MemoryStream())
{
doc.Save(stream, SaveFormat.Bmp);
@@ -2639,7 +2639,7 @@ public void ImageWatermark()
imageWatermarkOptions.Scale = 5;
imageWatermarkOptions.IsWashout = false;
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
doc.Watermark.SetImage(Image.FromFile(ImageDir + "Logo.jpg"), imageWatermarkOptions);
#elif NET5_0_OR_GREATER
using (SKBitmap image = SKBitmap.Decode(ImageDir + "Logo.jpg"))
diff --git a/Examples/ApiExamples/ApiExamples/ExDrawing.cs b/Examples/ApiExamples/ApiExamples/ExDrawing.cs
index 1c0f85082..a176acb51 100644
--- a/Examples/ApiExamples/ApiExamples/ExDrawing.cs
+++ b/Examples/ApiExamples/ApiExamples/ExDrawing.cs
@@ -15,7 +15,7 @@
using Aspose.Words.Drawing;
using NUnit.Framework;
using Shape = Aspose.Words.Drawing.Shape;
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
using System.Drawing.Imaging;
#endif
@@ -24,7 +24,7 @@ namespace ApiExamples
[TestFixture]
public class ExDrawing : ApiExampleBase
{
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
[Test]
public void VariousShapes()
{
@@ -299,7 +299,7 @@ public void SaveAllImages()
Assert.AreEqual(".Jpeg", fileInfos[0].Extension);
TestUtil.VerifyImage(400, 400, fileInfos[1].FullName);
Assert.AreEqual(".Png", fileInfos[1].Extension);
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
TestUtil.VerifyImage(382, 138, fileInfos[2].FullName);
Assert.AreEqual(".Emf", fileInfos[2].Extension);
TestUtil.VerifyImage(1600, 1600, fileInfos[3].FullName);
diff --git a/Examples/ApiExamples/ApiExamples/ExField.cs b/Examples/ApiExamples/ApiExamples/ExField.cs
index 95df6d104..d7c737071 100644
--- a/Examples/ApiExamples/ApiExamples/ExField.cs
+++ b/Examples/ApiExamples/ApiExamples/ExField.cs
@@ -3035,7 +3035,7 @@ void IFieldMergingCallback.ImageFieldMerging(ImageFieldMergingArgs args)
{
if (mImageFilenames.ContainsKey(args.FieldValue.ToString()))
{
- #if NET48 || JAVA
+ #if NET461_OR_GREATER || JAVA
args.Image = Image.FromFile(mImageFilenames[args.FieldValue.ToString()]);
#elif NET5_0_OR_GREATER
args.Image = SKBitmap.Decode(mImageFilenames[args.FieldValue.ToString()]);
diff --git a/Examples/ApiExamples/ApiExamples/ExFieldOptions.cs b/Examples/ApiExamples/ApiExamples/ExFieldOptions.cs
index d7ebeba5e..e0b7b8f17 100644
--- a/Examples/ApiExamples/ApiExamples/ExFieldOptions.cs
+++ b/Examples/ApiExamples/ApiExamples/ExFieldOptions.cs
@@ -436,7 +436,7 @@ public void BarcodeGenerator()
};
Image img = doc.FieldOptions.BarcodeGenerator.GetBarcodeImage(barcodeParameters);
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
img.Save(ArtifactsDir + "FieldOptions.BarcodeGenerator.QR.jpg");
#elif NET5_0_OR_GREATER
using (SKFileWStream fs = new SKFileWStream(ArtifactsDir + "FieldOptions.BarcodeGenerator.QR.jpg"))
@@ -457,7 +457,7 @@ public void BarcodeGenerator()
};
img = doc.FieldOptions.BarcodeGenerator.GetBarcodeImage(barcodeParameters);
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
img.Save(ArtifactsDir + "FieldOptions.BarcodeGenerator.EAN13.jpg");
#elif NET5_0_OR_GREATER
using (SKFileWStream fs = new SKFileWStream(ArtifactsDir + "FieldOptions.BarcodeGenerator.EAN13.jpg"))
@@ -476,7 +476,7 @@ public void BarcodeGenerator()
};
img = doc.FieldOptions.BarcodeGenerator.GetBarcodeImage(barcodeParameters);
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
img.Save(ArtifactsDir + "FieldOptions.BarcodeGenerator.CODE39.jpg");
#elif NET5_0_OR_GREATER
using (SKFileWStream fs = new SKFileWStream(ArtifactsDir + "FieldOptions.BarcodeGenerator.CODE39.jpg"))
@@ -495,7 +495,7 @@ public void BarcodeGenerator()
};
img = doc.FieldOptions.BarcodeGenerator.GetBarcodeImage(barcodeParameters);
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
img.Save(ArtifactsDir + "FieldOptions.BarcodeGenerator.ITF14.jpg");
#elif NET5_0_OR_GREATER
using (SKFileWStream fs = new SKFileWStream(ArtifactsDir + "FieldOptions.BarcodeGenerator.ITF14.jpg"))
diff --git a/Examples/ApiExamples/ApiExamples/ExHtmlSaveOptions.cs b/Examples/ApiExamples/ApiExamples/ExHtmlSaveOptions.cs
index 9c16712a1..a3d7eaebe 100644
--- a/Examples/ApiExamples/ApiExamples/ExHtmlSaveOptions.cs
+++ b/Examples/ApiExamples/ApiExamples/ExHtmlSaveOptions.cs
@@ -131,7 +131,7 @@ public void ExportTextBoxAsSvgEpub(SaveFormat saveFormat, bool isTextBoxAsSvg)
public void CreateAZW3Toc()
{
//ExStart
- //ExFor:HtmlSaveOptions.EpubNavigationMapLevel
+ //ExFor:HtmlSaveOptions.NavigationMapLevel
//ExSummary:Shows how to generate table of contents for Azw3 documents.
Document doc = new Document(MyDir + "Big document.docx");
@@ -146,7 +146,7 @@ public void CreateAZW3Toc()
public void CreateMobiToc()
{
//ExStart
- //ExFor:HtmlSaveOptions.EpubNavigationMapLevel
+ //ExFor:HtmlSaveOptions.NavigationMapLevel
//ExSummary:Shows how to generate table of contents for Mobi documents.
Document doc = new Document(MyDir + "Big document.docx");
@@ -834,7 +834,7 @@ public void ExportXhtmlTransitional(bool showDoctypeDeclaration)
public void EpubHeadings()
{
//ExStart
- //ExFor:HtmlSaveOptions.EpubNavigationMapLevel
+ //ExFor:HtmlSaveOptions.NavigationMapLevel
//ExSummary:Shows how to filter headings that appear in the navigation panel of a saved Epub document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
@@ -857,7 +857,7 @@ public void EpubHeadings()
// Epub readers typically create a table of contents for their documents.
// Each paragraph with a "Heading" style in the document will create an entry in this table of contents.
- // We can use the "EpubNavigationMapLevel" property to set a maximum heading level.
+ // We can use the "NavigationMapLevel" property to set a maximum heading level.
// The Epub reader will not add headings with a level above the one we specify to the contents table.
HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.Epub);
options.NavigationMapLevel = 2;
@@ -1744,7 +1744,7 @@ public void ScaleImageToShapeSize(bool scaleImageToShapeSize)
var testedImageLength = new FileInfo(ArtifactsDir + "HtmlSaveOptions.ScaleImageToShapeSize.001.png").Length;
if (scaleImageToShapeSize)
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
Assert.That(testedImageLength, Is.LessThan(3000));
#elif NET5_0_OR_GREATER
Assert.That(testedImageLength, Is.LessThan(6000));
diff --git a/Examples/ApiExamples/ApiExamples/ExHyphenation.cs b/Examples/ApiExamples/ApiExamples/ExHyphenation.cs
index 2ef228b2d..b2d25ff20 100644
--- a/Examples/ApiExamples/ApiExamples/ExHyphenation.cs
+++ b/Examples/ApiExamples/ApiExamples/ExHyphenation.cs
@@ -60,7 +60,7 @@ public void Dictionary()
TextAbsorber textAbsorber = new TextAbsorber();
textAbsorber.Visit(pdfDoc);
- Assert.True(textAbsorber.Text.Contains($"La ob storen an deinen am sachen. Dop-{Environment.NewLine}" +
+ Assert.True(textAbsorber.Text.Replace(" ", " ").Contains($"La ob storen an deinen am sachen. Dop-{Environment.NewLine}" +
$"pelte um da am spateren verlogen ge-{Environment.NewLine}" +
$"kommen achtzehn blaulich."));
@@ -68,7 +68,7 @@ public void Dictionary()
textAbsorber = new TextAbsorber();
textAbsorber.Visit(pdfDoc);
- Assert.True(textAbsorber.Text.Contains($"La ob storen an deinen am sachen. {Environment.NewLine}" +
+ Assert.True(textAbsorber.Text.Replace(" ", " ").Contains($"La ob storen an deinen am sachen. {Environment.NewLine}" +
$"Doppelte um da am spateren verlogen {Environment.NewLine}" +
$"gekommen achtzehn blaulich."));
}
diff --git a/Examples/ApiExamples/ApiExamples/ExImageSaveOptions.cs b/Examples/ApiExamples/ApiExamples/ExImageSaveOptions.cs
index 94173ed50..dfda188a3 100644
--- a/Examples/ApiExamples/ApiExamples/ExImageSaveOptions.cs
+++ b/Examples/ApiExamples/ApiExamples/ExImageSaveOptions.cs
@@ -14,7 +14,7 @@
using Aspose.Words.Saving;
using NUnit.Framework;
using Aspose.Words.Drawing;
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
using System.Drawing.Drawing2D;
using System.Drawing.Text;
#elif NET5_0_OR_GREATER || __MOBILE__
@@ -120,7 +120,7 @@ public void PageSet()
Assert.False(File.Exists(ArtifactsDir + "ImageSaveOptions.PageIndex.Page 4.gif"));
}
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
[Test]
public void GraphicsQuality()
{
@@ -245,7 +245,7 @@ public void PageByPage()
.Where(item => item.Contains("ImageSaveOptions.PageByPage.") && item.EndsWith(".tiff")).ToList();
Assert.AreEqual(3, imageFileNames.Count);
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
foreach (string imageFileName in imageFileNames)
TestUtil.VerifyImage(2325, 5325, imageFileName);
#endif
@@ -283,7 +283,7 @@ public void ColorMode(ImageColorMode imageColorMode)
var testedImageLength = new FileInfo(ArtifactsDir + "ImageSaveOptions.ColorMode.png").Length;
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
switch (imageColorMode)
{
case ImageColorMode.None:
@@ -387,7 +387,7 @@ public void PixelFormat(ImagePixelFormat imagePixelFormat)
var testedImageLength = new FileInfo(ArtifactsDir + "ImageSaveOptions.PixelFormat.png").Length;
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
switch (imagePixelFormat)
{
case ImagePixelFormat.Format1bppIndexed:
@@ -465,7 +465,7 @@ public void FloydSteinbergDithering()
doc.Save(ArtifactsDir + "ImageSaveOptions.FloydSteinbergDithering.tiff", options);
//ExEnd
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
TestUtil.VerifyImage(816, 1056, ArtifactsDir + "ImageSaveOptions.FloydSteinbergDithering.tiff");
#endif
}
diff --git a/Examples/ApiExamples/ApiExamples/ExMailMerge.cs b/Examples/ApiExamples/ApiExamples/ExMailMerge.cs
index 814024e08..739fcc2c5 100644
--- a/Examples/ApiExamples/ApiExamples/ExMailMerge.cs
+++ b/Examples/ApiExamples/ApiExamples/ExMailMerge.cs
@@ -25,7 +25,7 @@ namespace ApiExamples
[TestFixture]
public class ExMailMerge : ApiExampleBase
{
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
[Test]
public void ExecuteArray()
{
diff --git a/Examples/ApiExamples/ApiExamples/ExOoxmlSaveOptions.cs b/Examples/ApiExamples/ApiExamples/ExOoxmlSaveOptions.cs
index ede8ec35f..d21dbfc58 100644
--- a/Examples/ApiExamples/ApiExamples/ExOoxmlSaveOptions.cs
+++ b/Examples/ApiExamples/ApiExamples/ExOoxmlSaveOptions.cs
@@ -230,16 +230,16 @@ public void DocumentCompression(CompressionLevel compressionLevel)
switch (compressionLevel)
{
case CompressionLevel.Maximum:
- Assert.That(testedFileLength, Is.LessThan(1266000));
+ Assert.That(testedFileLength, Is.LessThan(1269000));
break;
case CompressionLevel.Normal:
- Assert.That(testedFileLength, Is.LessThan(1267000));
+ Assert.That(testedFileLength, Is.LessThan(1271000));
break;
case CompressionLevel.Fast:
- Assert.That(testedFileLength, Is.LessThan(1270000));
+ Assert.That(testedFileLength, Is.LessThan(1280000));
break;
case CompressionLevel.SuperFast:
- Assert.That(testedFileLength, Is.LessThan(1272000));
+ Assert.That(testedFileLength, Is.LessThan(1276000));
break;
}
}
diff --git a/Examples/ApiExamples/ApiExamples/ExParagraphFormat.cs b/Examples/ApiExamples/ApiExamples/ExParagraphFormat.cs
index a6d34d245..3c4e44049 100644
--- a/Examples/ApiExamples/ApiExamples/ExParagraphFormat.cs
+++ b/Examples/ApiExamples/ApiExamples/ExParagraphFormat.cs
@@ -416,11 +416,11 @@ public void SuppressHyphens(bool suppressAutoHyphens)
textAbsorber.Visit(pdfDoc);
if (suppressAutoHyphens)
- Assert.True(textAbsorber.Text.Contains($"La ob storen an deinen am sachen. {Environment.NewLine}" +
+ Assert.True(textAbsorber.Text.Replace(" ", " ").Contains($"La ob storen an deinen am sachen. {Environment.NewLine}" +
$"Doppelte um da am spateren verlogen {Environment.NewLine}" +
$"gekommen achtzehn blaulich."));
else
- Assert.True(textAbsorber.Text.Contains($"La ob storen an deinen am sachen. Dop-{Environment.NewLine}" +
+ Assert.True(textAbsorber.Text.Replace(" ", " ").Contains($"La ob storen an deinen am sachen. Dop-{Environment.NewLine}" +
$"pelte um da am spateren verlogen ge-{Environment.NewLine}" +
$"kommen achtzehn blaulich."));
}
diff --git a/Examples/ApiExamples/ApiExamples/ExPrinting.cs b/Examples/ApiExamples/ApiExamples/ExPrinting.cs
index 51ae37bc3..3ec025df6 100644
--- a/Examples/ApiExamples/ApiExamples/ExPrinting.cs
+++ b/Examples/ApiExamples/ApiExamples/ExPrinting.cs
@@ -7,7 +7,7 @@
using System;
using NUnit.Framework;
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
using System.Drawing.Printing;
using System.Windows.Forms;
using Aspose.Words;
@@ -19,7 +19,7 @@ namespace ApiExamples
[TestFixture]
public class ExPrinting : ApiExampleBase
{
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
[Test, Ignore("Run only when the printer driver is installed.")]
public void CustomPrint()
{
diff --git a/Examples/ApiExamples/ApiExamples/ExRendering.cs b/Examples/ApiExamples/ApiExamples/ExRendering.cs
index 570d8e895..7b1b7bf10 100644
--- a/Examples/ApiExamples/ApiExamples/ExRendering.cs
+++ b/Examples/ApiExamples/ApiExamples/ExRendering.cs
@@ -12,7 +12,7 @@
using Aspose.Words.Drawing.Charts;
using Aspose.Words.Rendering;
using NUnit.Framework;
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
using System.Collections.Generic;
using System.Windows.Forms;
using System.Drawing.Text;
@@ -25,7 +25,7 @@ namespace ApiExamples
[TestFixture]
public class ExRendering : ApiExampleBase
{
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
//ExStart
//ExFor:NodeRendererBase.RenderToScale(Graphics, Single, Single, Single)
//ExFor:NodeRendererBase.RenderToSize(Graphics, Single, Single, Single, Single)
diff --git a/Examples/ApiExamples/ApiExamples/ExReportingEngine.cs b/Examples/ApiExamples/ApiExamples/ExReportingEngine.cs
index f6e272749..ea142236a 100644
--- a/Examples/ApiExamples/ApiExamples/ExReportingEngine.cs
+++ b/Examples/ApiExamples/ApiExamples/ExReportingEngine.cs
@@ -1181,6 +1181,23 @@ public void InsertComboboxDropdownListItemsDynamically(SdtType sdtType)
}
}
+ [Test]
+ public void UpdateFieldsSyntaxAware()
+ {
+ //ExStart:UpdateFieldsSyntaxAware
+ //ReleaseVersion:23.11
+ Document doc = new Document(MyDir + "Reporting engine template - Fields.docx");
+
+ // Note that enabling of the option makes the engine to update fields while building a report,
+ // so there is no need to update fields separately after that.
+ ReportingEngine engine = new ReportingEngine();
+ BuildReport(doc, new string[] { "First topic", "Second topic", "Third topic" }, "topics",
+ ReportBuildOptions.UpdateFieldsSyntaxAware);
+
+ doc.Save(ArtifactsDir + "ReportingEngine.UpdateFieldsSyntaxAware.docx");
+ //ExEnd:UpdateFieldsSyntaxAware
+ }
+
private static void BuildReport(Document document, object dataSource, ReportBuildOptions reportBuildOptions)
{
ReportingEngine engine = new ReportingEngine { Options = reportBuildOptions };
diff --git a/Examples/ApiExamples/ApiExamples/ExRevision.cs b/Examples/ApiExamples/ApiExamples/ExRevision.cs
index 7414eb8cd..4d4a5d2e3 100644
--- a/Examples/ApiExamples/ApiExamples/ExRevision.cs
+++ b/Examples/ApiExamples/ApiExamples/ExRevision.cs
@@ -292,5 +292,60 @@ public void RevisionOptions()
doc.Save(ArtifactsDir + "Revision.RevisionOptions.pdf");
//ExEnd
}
+
+ //ExStart:RevisionSpecifiedCriteria
+ //ReleaseVersion:23.11
+ //ExFor:RevisionCollection.Accept(IRevisionCriteria)
+ //ExFor:RevisionCollection.Reject(IRevisionCriteria)
+ //ExSummary:Shows how to accept or reject revision based on criteria.
+ [Test] //ExSkip
+ public void RevisionSpecifiedCriteria()
+ {
+ Document doc = new Document();
+ DocumentBuilder builder = new DocumentBuilder(doc);
+ builder.Write("This does not count as a revision. ");
+
+ // To register our edits as revisions, we need to declare an author, and then start tracking them.
+ doc.StartTrackRevisions("John Doe", DateTime.Now);
+ builder.Write("This is insertion revision #1. ");
+ doc.StopTrackRevisions();
+
+ doc.StartTrackRevisions("Jane Doe", DateTime.Now);
+ builder.Write("This is insertion revision #2. ");
+ // Remove a run "This does not count as a revision.".
+ doc.FirstSection.Body.FirstParagraph.Runs[0].Remove();
+ doc.StopTrackRevisions();
+
+ Assert.AreEqual(3, doc.Revisions.Count);
+ // We have two revisions from different authors, so we need to accept only one.
+ doc.Revisions.Accept(new RevisionCriteria("John Doe", RevisionType.Insertion));
+ Assert.AreEqual(2, doc.Revisions.Count);
+ // Reject revision with different author name and revision type.
+ doc.Revisions.Reject(new RevisionCriteria("Jane Doe", RevisionType.Deletion));
+ Assert.AreEqual(1, doc.Revisions.Count);
+
+ doc.Save(ArtifactsDir + "Revision.RevisionSpecifiedCriteria.docx");
+ }
+
+ ///
+ /// Control when certain revision should be accepted/rejected.
+ ///
+ public class RevisionCriteria : IRevisionCriteria
+ {
+ private readonly string AuthorName;
+ private readonly RevisionType RevisionType;
+
+ public RevisionCriteria(string authorName, RevisionType revisionType)
+ {
+ AuthorName = authorName;
+ RevisionType = revisionType;
+ }
+
+ public bool IsMatch(Revision revision)
+ {
+ return revision.Author == AuthorName && revision.RevisionType == RevisionType;
+ }
+ }
+ //ExEnd:RevisionSpecifiedCriteria
}
}
diff --git a/Examples/ApiExamples/ApiExamples/ExShape.cs b/Examples/ApiExamples/ApiExamples/ExShape.cs
index 7903ca806..11a67c421 100644
--- a/Examples/ApiExamples/ApiExamples/ExShape.cs
+++ b/Examples/ApiExamples/ApiExamples/ExShape.cs
@@ -2991,7 +2991,7 @@ public void RelativeSizeAndPosition()
public void FillBaseColor()
{
//ExStart:FillBaseColor
- //GistId:3428e84add5beb0d46a8face6e5fc858
+ //GistId:3428e84add5beb0d46a8face6e5fc858
//ExFor:Fill.BaseForeColor
//ExFor:Stroke.BaseForeColor
//ExSummary:Shows how to get foreground color without modifiers.
@@ -3019,7 +3019,7 @@ public void FillBaseColor()
public void FitImageToShape()
{
//ExStart:FitImageToShape
- //GistId:3428e84add5beb0d46a8face6e5fc858
+ //GistId:3428e84add5beb0d46a8face6e5fc858
//ExFor:ImageData.FitImageToShape
//ExSummary:Shows hot to fit the image data to Shape frame.
Document doc = new Document();
diff --git a/Examples/ApiExamples/ApiExamples/ExSignDocumentCustom.cs b/Examples/ApiExamples/ApiExamples/ExSignDocumentCustom.cs
index 02388a58a..ab36f7fef 100644
--- a/Examples/ApiExamples/ApiExamples/ExSignDocumentCustom.cs
+++ b/Examples/ApiExamples/ApiExamples/ExSignDocumentCustom.cs
@@ -11,7 +11,7 @@
using Aspose.Words.DigitalSignatures;
using Aspose.Words.Drawing;
using NUnit.Framework;
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
@@ -90,7 +90,7 @@ private static void SignDocument(string srcDocumentPath, string dstDocumentPath,
///
private static byte[] ImageToByteArray(string imagePath)
{
-#if NET48 || JAVA
+#if NET461_OR_GREATER || JAVA
Image image = Image.FromFile(imagePath);
using (MemoryStream ms = new MemoryStream())
{
diff --git a/Examples/ApiExamples/ApiExamples/ExStructuredDocumentTag.cs b/Examples/ApiExamples/ApiExamples/ExStructuredDocumentTag.cs
index 61e4bbabd..d702c731c 100644
--- a/Examples/ApiExamples/ApiExamples/ExStructuredDocumentTag.cs
+++ b/Examples/ApiExamples/ApiExamples/ExStructuredDocumentTag.cs
@@ -58,7 +58,6 @@ public void FlatOpcContent()
//ExEnd
}
-
[Test]
public void ApplyStyle()
{
@@ -1270,5 +1269,23 @@ public void Citation()
doc.Save(ArtifactsDir + "StructuredDocumentTag.Citation.docx");
}
+
+ [Test]
+ public void RangeStartWordOpenXMLMinimal()
+ {
+ //ExStart:RangeStartWordOpenXMLMinimal
+ //ReleaseVersion:23.11
+ //ExFor:StructuredDocumentTagRangeStart.WordOpenXMLMinimal
+ //ExSummary:Shows how to get minimal XML contained within the node in the FlatOpc format.
+ Document doc = new Document(MyDir + "Multi-section structured document tags.docx");
+ StructuredDocumentTagRangeStart tag =
+ doc.GetChild(NodeType.StructuredDocumentTagRangeStart, 0, true) as StructuredDocumentTagRangeStart;
+
+ Assert.True(tag.WordOpenXMLMinimal
+ .Contains(
+ ""));
+ Assert.False(tag.WordOpenXMLMinimal.Contains("xmlns:w16cid=\"http://schemas.microsoft.com/office/word/2016/wordml/cid\""));
+ //ExEnd:
+ }
}
}
diff --git a/Examples/ApiExamples/ApiExamples/ExXlsxSaveOptions.cs b/Examples/ApiExamples/ApiExamples/ExXlsxSaveOptions.cs
index f220fc2a9..27fd1a87e 100644
--- a/Examples/ApiExamples/ApiExamples/ExXlsxSaveOptions.cs
+++ b/Examples/ApiExamples/ApiExamples/ExXlsxSaveOptions.cs
@@ -28,5 +28,23 @@ public void CompressXlsx()
doc.Save(ArtifactsDir + "XlsxSaveOptions.CompressXlsx.xlsx", xlsxSaveOptions);
//ExEnd
}
+
+ [Test]
+ public void SelectionMode()
+ {
+ //ExStart:SelectionMode
+ //ReleaseVersion:23.11
+ //ExFor:XlsxSaveOptions.SectionMode
+ //ExSummary:Shows how to save document as a separate worksheets.
+ Document doc = new Document(MyDir + "Big document.docx");
+
+ // Each section of a document will be created as a separate worksheet.
+ // Use 'SingleWorksheet' to display all document on one worksheet.
+ XlsxSaveOptions xlsxSaveOptions = new XlsxSaveOptions();
+ xlsxSaveOptions.SectionMode = XlsxSectionMode.MultipleWorksheets;
+
+ doc.Save(ArtifactsDir + "XlsxSaveOptions.SelectionMode.xlsx", xlsxSaveOptions);
+ //ExEnd:SelectionMode
+ }
}
-}
\ No newline at end of file
+}
diff --git a/Examples/Data/Reporting engine template - Fields.docx b/Examples/Data/Reporting engine template - Fields.docx
new file mode 100644
index 000000000..32c9a59b2
Binary files /dev/null and b/Examples/Data/Reporting engine template - Fields.docx differ