Chart Axis Title Customization
A new public class ChartAxisTitle
has been implemented. And a property Title
of this type has been added. C# developers can now set the title of chart axes for better visualization and data interpretation.
This feature empowers developers to create more informative and visually appealing charts within their C# and .NET applications.
The following C# code sample* demonstrates how to set and show title of X and Y axes:
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET.git.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.InsertChart(ChartType.Column, 432, 252);
Chart chart = shape.Chart;
ChartSeriesCollection seriesColl = chart.Series;
// Delete default generated series.
seriesColl.Clear();
seriesColl.Add("AW Series 1", new string[] { "AW Category 1", "AW Category 2" }, new double[] { 1, 2 });
// Set axis title.
chart.AxisX.Title.Text = "Categories";
chart.AxisX.Title.Show = true;
chart.AxisY.Title.Text = "Values";
chart.AxisY.Title.Show = true;
chart.AxisY.Title.Overlay = true;
doc.Save(ArtifactsDir + "Charts.ChartAxisTitle.docx");
Source*
Clear and informative chart axis titles improve data interpretation and user understanding of complex information.
Enhanced Markdown Export with Images Folder Alias
The new ImagesFolderAlias
property in the MarkdownSaveOptions
class simplifies image handling during Markdown conversion.
Developers can now specify a custom alias for the image folder, streamlining file organization and improving export performance. This feature of the API comes in handy when constructing name URIs instead of the image folder name.
This following C# sample code* shows how to use ImagesFolderAlias
property within MarkdownSaveOptions
:
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET.git.
DocumentBuilder builder = new DocumentBuilder();
builder.Writeln("Some image below:");
builder.InsertImage(ImageDir + "Logo.jpg");
string imagesFolder = Path.Combine(ArtifactsDir, "ImagesDir");
MarkdownSaveOptions saveOptions = new MarkdownSaveOptions();
// Use the "ImagesFolder" property to assign a folder in the local file system into which
// Aspose.Words will save all the document's linked images.
saveOptions.ImagesFolder = imagesFolder;
// Use the "ImagesFolderAlias" property to use this folder
// when constructing image URIs instead of the images folder's name.
saveOptions.ImagesFolderAlias = "http://example.com/images";
builder.Document.Save(ArtifactsDir + "MarkdownSaveOptions.ImagesFolder.md", saveOptions);
Source*
Precise Vertical Font Layout Control
Aspose.Words for .NET now allows developers to specify the vertical position of fonts within a paragraph.
A new public property BaselineAlignment
has been added to class ParagraphFormat
and a new public Enum has been introduced.
This provides granular control over text layout and enables developers to achieve precise alignment and visual aesthetics.
The following c# code* example explains how to use API to align paragraph within a DOCX
document:
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET.git.
Document doc = new Document(MyDir + "Office math.docx");
ParagraphFormat format = doc.FirstSection.Body.Paragraphs[0].ParagraphFormat;
if (format.BaselineAlignment == BaselineAlignment.Auto)
{
format.BaselineAlignment = BaselineAlignment.Top;
}
doc.Save(ArtifactsDir + "ParagraphFormat.ParagraphBaselineAlignment.docx");
Source*
The ScaleWmfFontsToMetafileSize
property has been replaced with EmulateRenderingToSizeOnPage
and added EmulateRenderingToSizeOnPageResolution
.
WMF pen width and EMF cosmetic pen rendering now emulate rasterization size for more accurate and consistent representation.
This enhancement ensures high-fidelity metafile rendering and eliminates visual discrepancies.
The following C# code* example shows how to use API to emulate rendering according to the metafile size on page:
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET.git.
Document doc = new Document(MyDir + "WMF with text.docx");
// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
PdfSaveOptions saveOptions = new PdfSaveOptions();
// Set the "EmulateRenderingToSizeOnPage" property to "true"
// to emulate rendering according to the metafile size on page.
// Set the "EmulateRenderingToSizeOnPage" property to "false"
// to emulate metafile rendering to its default size in pixels.
saveOptions.MetafileRenderingOptions.EmulateRenderingToSizeOnPage = renderToSize;
saveOptions.MetafileRenderingOptions.EmulateRenderingToSizeOnPageResolution = 50;
doc.Save(ArtifactsDir + "PdfSaveOptions.EmulateRenderingToSizeOnPage.pdf", saveOptions);
Source*
For a complete list of features, enhancements, and bug fixes in this release please visit, Aspose.Words for .NET 23.9 Release Notes.