Custom Page Layout Specification in PDF Readers
In this release of the C# MS Word API, new public PageLayout
property is added to the PdfSaveOptions
class. New public PdfPageLayout
enumeration has also been introduced.
By integrating this feature into the .NET apps, C# developers can define the initial page layout for documents opened in PDF readers.
Please check the following C# coding sample to learn how to customize layout in readers using the C# API:
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET.git.
Document doc = new Document(MyDir + "Big document.docx");
// Display the pages two at a time, with odd-numbered pages on the left.
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.PageLayout = PdfPageLayout.TwoPageLeft;
doc.Save(ArtifactsDir + "PdfSaveOptions.PageLayout.pdf", saveOptions);
Source*
Merge An Array of Documents into One File
A new public method Merge(Document[], MergeFormatMode)
has been introduced to the LowCode.Merger
class in this release.
This intuitive functionality allows you to merge documents in a simplified manner and requires only a few lines of code.
The below-given C# code example showcases the use of this method for merging multiple documents in C#:
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET.git.
DocumentBuilder firstDoc = new DocumentBuilder();
firstDoc.Font.Size = 16;
firstDoc.Font.Color = Color.Blue;
firstDoc.Write("Hello first word!");
DocumentBuilder secondDoc = new DocumentBuilder();
secondDoc.Write("Hello second word!");
Document mergedDoc = Merger.Merge(new Document[] { firstDoc.Document, secondDoc.Document }, MergeFormatMode.KeepSourceLayout);
Assert.AreEqual("Hello first word!\fHello second word!\f", mergedDoc.GetText());
Source*
Insert WebP Images into Your Word Documents
This release brings a new addition in the form of WebP image support in the DocumentBuilder
class.
Optimize your C# solutions and effortlessly read and add .WEBP images to the Word (.DOCX) documents in .NET Standard & .NET6+.
The following C# sample code shares how to insert WebP images in .NET Word documents:
// 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 + "WebP image.webp");
doc.Save(ArtifactsDir + "Image.InsertWebpImage.docx");
Source*
Please visit Aspose.Words for .NET 23.12 Release Notes to view a comprehensive list of new features, enhancements, and bug fixes in this release.