Skip to content

Instantly share code, notes, and snippets.

@aspose-words-gists
aspose-words-gists / building-column-chart.cs
Created June 4, 2024 18:38
Aspose.Words for .NET. How to build a column chart using LINQ Reporting Engine in C#.
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET.
// Open the template document.
Document doc = new Document(MyLinqDir + "Column Chart Template.docx");
// Open the data source file.
JsonDataSource dataSource = new JsonDataSource(MyLinqDir + "Column Chart Data.json");
// Build a report. The name of the data source should match the one used in the template.
ReportingEngine engine = new ReportingEngine();
engine.BuildReport(doc, dataSource, "items");
@aspose-words-gists
aspose-words-gists / box-and-whisker-chart.cs
Last active June 4, 2024 10:44
Examples for a release notes 24.6 .NET version
// 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);
// Insert a Box & Whisker chart.
Shape shape = builder.InsertChart(ChartType.BoxAndWhisker, 450, 450);
Chart chart = shape.Chart;
chart.Title.Text = "Points by Years";
// Delete default generated series.
@aspose-words-gists
aspose-words-gists / adjustments.cs
Created April 30, 2024 12:03
Examples for a release notes 24.5 .NET version
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET.git.
Document doc = new Document(MyDir + "Rounded rectangle shape.docx");
Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);
AdjustmentCollection adjustments = shape.Adjustments;
Assert.AreEqual(1, adjustments.Count);
Adjustment adjustment = adjustments[0];
Assert.AreEqual("adj", adjustment.Name);
Assert.AreEqual(16667, adjustment.Value);
@aspose-words-gists
aspose-words-gists / chart-format.java
Created April 12, 2024 11:38
Examples for a release notes 24.4 Java version
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Java.git.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.insertChart(ChartType.COLUMN, 432.0, 252.0);
Chart chart = shape.getChart();
// Delete series generated by default.
ChartSeriesCollection series = chart.getSeries();
series.clear();
@aspose-words-gists
aspose-words-gists / docx-to-xlsx.cs
Last active April 2, 2024 12:28
Aspose.Words for .NET. Converting a document to xlsx using C#.
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET.git.
Document doc = new Document(MyDir + "Document.docx");
doc.Save(ArtifactsDir + "BaseConversions.DocxToXlsx.xlsx");
@aspose-words-gists
aspose-words-gists / chart-format.cs
Last active April 30, 2024 12:04
Examples for a release notes 24.4 .NET version
// 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;
// Delete series generated by default.
ChartSeriesCollection series = chart.Series;
series.Clear();
@aspose-words-gists
aspose-words-gists / adjustments.java
Last active June 4, 2024 10:03
Aspose.Words for Java. Examples for a release notes 24.5 Java version.
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Java.git.
Document doc = new Document(getMyDir() + "Rounded rectangle shape.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
AdjustmentCollection adjustments = shape.getAdjustments();
Assert.assertEquals(1, adjustments.getCount());
Adjustment adjustment = adjustments.get(0);
Assert.assertEquals("adj", adjustment.getName());
Assert.assertEquals(16667, adjustment.getValue());
@aspose-words-gists
aspose-words-gists / tiff-image-compression.cs
Created February 29, 2024 08:07
Examples for a release notes 24.3 .NET version
// 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);
builder.InsertImage(ImageDir + "Tagged Image File Format.tiff");
// Create an "ImageSaveOptions" object which we can pass to the document's "Save" method
// to modify the way in which that method renders the document into an image.
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Tiff);
// Set the "TiffCompression" property to "TiffCompression.None" to apply no compression while saving,
@aspose-words-gists
aspose-words-gists / appearance.java
Last active February 9, 2024 14:21
Examples for a release notes 24.2 Java version
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Java.git.
Document doc = new Document(getMyDir() + "Multi-section structured document tags.docx");
StructuredDocumentTagRangeStart tag = (StructuredDocumentTagRangeStart) doc.getChild(NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_START, 0, true);
if (tag.getAppearance() == SdtAppearance.HIDDEN)
tag.setAppearance(SdtAppearance.TAGS);
@aspose-words-gists
aspose-words-gists / appearance.cs
Last active February 29, 2024 08:06
Examples for a release notes 24.2 .NET version
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET.git.
Document doc = new Document(MyDir + "Multi-section structured document tags.docx");
StructuredDocumentTagRangeStart tag =
doc.GetChild(NodeType.StructuredDocumentTagRangeStart, 0, true) as StructuredDocumentTagRangeStart;
if (tag.Appearance == SdtAppearance.Hidden)
tag.Appearance = SdtAppearance.Tags;