Class OtgImage

Class OtgImage

Namespace: Aspose.Imaging.FileFormats.OpenDocument
Assembly: Aspose.Imaging.dll (25.2.0)

Process OpenDocument Template (OTG) drawing image files with our API, leveraging the OpenDocument XML format with Graphics Content for seamless manipulation. Easily parse documents, customize background colors, and adjust page dimensions, ensuring optimal control and flexibility for your OTG vector graphics projects.

[JsonObject(MemberSerialization.OptIn)]
public class OtgImage : OdImage, IDisposable, IObjectWithBounds, IObjectWithSizeF, IMultipageImage

Inheritance

objectDisposableObjectDataStreamSupporterImageVectorImageVectorMultipageImageOdImageOtgImage

Implements

IDisposable, IObjectWithBounds, IObjectWithSizeF, IMultipageImage

Inherited Members

OdImage.ReleaseManagedResources(), OdImage.DefaultPage, OdImage.IsCached, OdImage.BitsPerPixel, OdImage.PageCount, OdImage.Metadata, OdImage.Records, VectorMultipageImage.CacheData(), VectorMultipageImage.Crop(Rectangle), VectorMultipageImage.Resize(int, int, ResizeType), VectorMultipageImage.Rotate(float), VectorMultipageImage.Resize(int, int, ImageResizeSettings), VectorMultipageImage.RotateFlip(RotateFlipType), VectorMultipageImage.RemoveBackground(RemoveBackgroundSettings), VectorMultipageImage.RemoveBackground(), VectorMultipageImage.SetPalette(IColorPalette, bool), VectorMultipageImage.GetEmbeddedImages(), VectorMultipageImage.SaveData(Stream), VectorMultipageImage.GetSerializedStream(ImageOptionsBase, Rectangle, out int), VectorMultipageImage.ReleaseManagedResources(), VectorMultipageImage.PageCount, VectorMultipageImage.Pages, VectorMultipageImage.DefaultPage, VectorMultipageImage.IsCached, VectorMultipageImage.BitsPerPixel, VectorMultipageImage.Width, VectorMultipageImage.Height, VectorMultipageImage.PageExportingAction, VectorImage.GetEmbeddedImages(), VectorImage.RemoveBackground(), VectorImage.RemoveBackground(RemoveBackgroundSettings), VectorImage.Resize(int, int, ResizeType), VectorImage.Resize(int, int, ImageResizeSettings), VectorImage.RotateFlip(RotateFlipType), VectorImage.Crop(Rectangle), VectorImage.Rotate(float), VectorImage.Modify(RectangleF, float, float, float), VectorImage.SizeF, VectorImage.WidthF, VectorImage.HeightF, VectorImage.Width, VectorImage.Height, Image.CanLoad(string), Image.CanLoad(string, LoadOptions), Image.CanLoad(Stream), Image.CanLoad(Stream, LoadOptions), Image.Create(ImageOptionsBase, int, int), Image.Create(Image[]), Image.Create(MultipageCreateOptions), Image.Create(string[], bool), Image.Create(string[]), Image.Create(Image[], bool), Image.GetFileFormat(string), Image.GetFileFormat(Stream), Image.GetFittingRectangle(Rectangle, int, int), Image.GetFittingRectangle(Rectangle, int[], int, int), Image.Load(string, LoadOptions), Image.Load(string), Image.Load(Stream, LoadOptions), Image.Load(Stream), Image.GetProportionalWidth(int, int, int), Image.GetProportionalHeight(int, int, int), Image.RemoveMetadata(), Image.CanSave(ImageOptionsBase), Image.Resize(int, int), Image.Resize(int, int, ResizeType), Image.Resize(int, int, ImageResizeSettings), Image.GetDefaultOptions(object[]), Image.GetOriginalOptions(), Image.ResizeWidthProportionally(int), Image.ResizeHeightProportionally(int), Image.ResizeWidthProportionally(int, ResizeType), Image.ResizeHeightProportionally(int, ResizeType), Image.ResizeWidthProportionally(int, ImageResizeSettings), Image.ResizeHeightProportionally(int, ImageResizeSettings), Image.RotateFlip(RotateFlipType), Image.Rotate(float), Image.Crop(Rectangle), Image.Crop(int, int, int, int), Image.Save(), Image.Save(string), Image.Save(string, ImageOptionsBase), Image.Save(string, ImageOptionsBase, Rectangle), Image.Save(Stream, ImageOptionsBase), Image.Save(Stream, ImageOptionsBase, Rectangle), Image.GetSerializedStream(ImageOptionsBase, Rectangle, out int), Image.SetPalette(IColorPalette, bool), Image.UpdateContainer(Image), Image.GetCanNotSaveMessage(ImageOptionsBase), Image.GetFitRectangle(Rectangle), Image.GetImage2Export(ImageOptionsBase, Rectangle, IImageExporter), Image.GetFitRectangle(Rectangle, int[]), Image.OnPaletteChanged(IColorPalette, IColorPalette), Image.OnPaletteChanging(IColorPalette, IColorPalette), Image.ReleaseManagedResources(), Image.BitsPerPixel, Image.Bounds, Image.Container, Image.Height, Image.Palette, Image.UsePalette, Image.Size, Image.Width, Image.InterruptMonitor, Image.BufferSizeHint, Image.AutoAdjustPalette, Image.HasBackgroundColor, Image.FileFormat, Image.BackgroundColor, DataStreamSupporter.timeout, DataStreamSupporter.CacheData(), DataStreamSupporter.Save(), DataStreamSupporter.Save(Stream), DataStreamSupporter.Save(string), DataStreamSupporter.Save(string, bool), DataStreamSupporter.SaveData(Stream), DataStreamSupporter.ReleaseManagedResources(), DataStreamSupporter.OnDataStreamContainerChanging(StreamContainer), DataStreamSupporter.DataStreamContainer, DataStreamSupporter.IsCached, DisposableObject.Dispose(), DisposableObject.ReleaseManagedResources(), DisposableObject.ReleaseUnmanagedResources(), DisposableObject.VerifyNotDisposed(), DisposableObject.Disposed, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Examples

The following code snippet demonstrates how to convert an OTG image to PDF and other image formats.```csharp [C#]

                                                                                                          string dir = "c:\\aspose.imaging\\issues\\net\\3567\\";
                                                                                                          string inputFilePath = dir + "VariousObjectsMultiPage.otg";
                                                                                                          Aspose.Imaging.ImageOptionsBase[] options = { new Aspose.Imaging.ImageOptions.PngOptions(), new Aspose.Imaging.ImageOptions.PdfOptions() };
                                                                                                          foreach (Aspose.Imaging.ImageOptionsBase saveOptions in options)
                                                                                                          {
                                                                                                              string extension = saveOptions is Aspose.Imaging.ImageOptions.PngOptions ? ".png" : ".pdf";
                                                                                                              using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputFilePath))
                                                                                                              {
                                                                                                                  Aspose.Imaging.ImageOptions.OtgRasterizationOptions otgRasterizationOptions = new Aspose.Imaging.ImageOptions.OtgRasterizationOptions();
                                                                                                                  otgRasterizationOptions.PageSize = image.Size;
                                                                                                                  saveOptions.VectorRasterizationOptions = otgRasterizationOptions;

                                                                                                                  image.Save(inputFilePath + extension, saveOptions);
                                                                                                              }
                                                                                                          }

## Constructors

### <a id="Aspose_Imaging_FileFormats_OpenDocument_OtgImage__ctor_Aspose_Imaging_StreamContainer_Aspose_Imaging_LoadOptions_"></a> OtgImage\(StreamContainer, LoadOptions\)

Initialize a new Aspose.Imaging.FileFormats.OpenDocument.OtgImage object by providing a stream container 
and loading options. This constructor empowers developers to efficiently load OTG 
images from streams while specifying custom loading configurations.

```csharp
public OtgImage(StreamContainer streamContainer, LoadOptions loadOptions)

Parameters

streamContainer StreamContainer

The stream.

loadOptions LoadOptions

The load options.

OtgImage(StreamContainer)

Create a new object of the Aspose.Imaging.FileFormats.OpenDocument.OtgImage class by supplying a stream container. This constructor enables developers to create OTG images directly from stream containers, streamlining the process of working with OTG image data.

public OtgImage(StreamContainer streamContainer)

Parameters

streamContainer StreamContainer

The stream container.

Properties

FileFormat

This property provides access to the OTG file format, offering crucial insights into the type of data encapsulated within the image file. It serves as a pivotal reference point for software developers, enabling them to effectively handle OTG files within their applications. By utilizing this property, you can ascertain the specific format of the image file, facilitating seamless integration and manipulation of OTG files in their software systems.

public override FileFormat FileFormat { get; }

Property Value

FileFormat

Pages

Retrieves the collection of pages associated with the image, enabling software developers to access and manipulate each individual page efficiently. This property facilitates seamless iteration through the pages for various operations, enhancing the functionality and versatility of image processing applications.

public override Image[] Pages { get; }

Property Value

Image[]

Methods

GetDefaultOptions(object[])

Retrieves the default options configured for the image, providing a convenient way to access and modify the default settings. This property ensures consistency in operations by offering predefined settings that align with common use cases, simplifying the development process.

public override ImageOptionsBase GetDefaultOptions(object[] args)

Parameters

args object[]

The arguments.

Returns

ImageOptionsBase

Default options