Good news for .NET developers! Aspose.Slides for .NET 24.8 (DLLs only) is now available, and it features a compelling set of enhancements, bug fixes, and new features to streamline your presentation processing workflows.
Rendering Boost
Experience elevated accuracy while converting presentations to PDF documents in your C# PowerPoint conversion applications, including enhanced rendering of charts, text, and axis labels.
Add Tiled Picture Fills
Get better control over the presentation look and feel with the latest .NET presentations API version. It now supports creating tiled picture fills for shapes and backgrounds, as highlighted in the following code examples.
Add a new Rectangle shape with a tiled picture:
using (Presentation pres = new Presentation())
{
ISlide firstSlide = pres.Slides[0];
IPPImage ppImage;
using (IImage newImage = Aspose.Slides.Images.FromFile("image.png"))
ppImage = pres.Images.AddImage(newImage);
// Adds the new Rectangle shape
var newShape = firstSlide.Shapes.AddAutoShape(ShapeType.Rectangle, 0, 0, 350, 350);
// Sets the fill type of the new shape to Picture
newShape.FillFormat.FillType = FillType.Picture;
// Sets the shape's fill image
IPictureFillFormat pictureFillFormat = newShape.FillFormat.PictureFillFormat;
pictureFillFormat.Picture.Image = ppImage;
// Sets the picture fill mode to Tile and changes the properties
pictureFillFormat.PictureFillMode = PictureFillMode.Tile;
pictureFillFormat.TileOffsetX = -275;
pictureFillFormat.TileOffsetY = -247;
pictureFillFormat.TileScaleX = 25;
pictureFillFormat.TileScaleY = 15;
pictureFillFormat.TileAlignment = RectangleAlignment.BottomRight;
pictureFillFormat.TileFlip = TileFlip.FlipBoth;
pres.Save("Tile.pptx", SaveFormat.Pptx);
}
Source*
Apply background fill type to the tiled picture fill:
using (Presentation pres = new Presentation())
{
ISlide firstSlide = pres.Slides[0];
IPPImage ppImage;
using (IImage newImage = Aspose.Slides.Images.FromFile("image.png"))
ppImage = pres.Images.AddImage(newImage);
// Gets the background of the first slide
IBackground background = firstSlide.Background;
// Sets the type of the background to OwnBackground.
background.Type = BackgroundType.OwnBackground;
// Sets the fill type of the background to Picture
background.FillFormat.FillType = FillType.Picture;
// Sets the background fill image
IPictureFillFormat backPictureFillFormat = background.FillFormat.PictureFillFormat;
backPictureFillFormat.Picture.Image = ppImage;
// Sets the picture fill mode to Tile and changes the properties
backPictureFillFormat.PictureFillMode = PictureFillMode.Tile;
backPictureFillFormat.TileOffsetX = 15f;
backPictureFillFormat.TileOffsetY = 15f;
backPictureFillFormat.TileScaleX = 46f;
backPictureFillFormat.TileScaleY = 87f;
backPictureFillFormat.TileAlignment = RectangleAlignment.Center;
backPictureFillFormat.TileFlip = TileFlip.FlipY;
pres.Save("BackgroundTile.pptx", SaveFormat.Pptx);
}
Source*
Access Font Data
Aspose.Slides for .NET now offers extracting byte data of fonts from within presentations and provides advanced font management features. The following code samples illustrate how to fetch binary font data and get embedding levels for a font, respectively.
using (Presentation pres = new Presentation ("Presentation.pptx"))
{
// Retrieve all fonts used in the presentation
IFontData[] fonts = pres.FontsManager.GetFonts();
// Get the byte array representing the regular style of the first font in the presentation
bytes = pres.FontsManager.GetFontBytes(fonts[0], FontStyle.Regular);
}
Source*
using (Presentation pres = new Presentation(pptxFileName))
{
// Retrieve all fonts used in the presentation
IFontData[] fontDatas = pres.FontsManager.GetFonts();
// Get the byte array representing the regular style of the first font in the presentation
byte[] bytes = pres.FontsManager.GetFontBytes(fontDatas[0], FontStyle.Regular);
// Determine the embedding level of the font
EmbeddingLevel embeddingLevel = pres.FontsManager.GetFontEmbeddingLevel(bytes, fontDatas[0].FontName);
}
Source*
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting Aspose.Slides for .NET 24.8 Release Notes.