GemBox.Presentation
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    ComHelper Class

    Namespace:
    GemBox.Presentation
    Assembly:
    GemBox.Presentation.dll

    Contains methods that can be useful for users which are calling GemBox.Presentation component using COM interop.

    • C#
    • VB.NET
    [ComVisible(true)]
    public class ComHelper
    <ComVisible(True)>
    Inheritance:
    System.Object
    ComHelper

    Constructors

    ComHelper()

    Initializes a new instance of the ComHelper class.

    • C#
    • VB.NET
    public ComHelper()
    Public Sub New

    Methods

    AddNewSlide(Object, Object)

    Adds a new Slide with the specified parent layout template to the end of the collection.

    • C#
    • VB.NET
    public Slide AddNewSlide(object slides, object layoutSlide)
    Public Function AddNewSlide(slides As Object, layoutSlide As Object) As Slide
    Parameters
    slides
    System.Object

    A Slides collection.

    layoutSlide
    System.Object

    The parent layout template of a new Slide.

    Returns
    Slide

    A new Slide with the specified parent layout template added to the collection.

    ComSetLicense(String)

    Call this method from your application to set GemBox.Presentation serial key.

    • C#
    • VB.NET
    public void ComSetLicense(string serialKey)
    Public Sub ComSetLicense(serialKey As String)
    Parameters
    serialKey
    System.String

    The serial key.

    Remarks

    You should call this method before using any other class from GemBox.Presentation assembly.

    Key can only be set once (if you try another key, exception will be thrown).

    The best place to call this method is from static constructor of your application's main class.

    Valid serial key has multiple groups of alphanumeric characters, separated with dashes.

    To use the assembly in free limited mode use FREE-LIMITED-KEY as serialKey.

    For more information about GemBox.Presentation evaluation and licensing, see evaluation and licensing.

    CreateColor(Int32, Int32, Int32)

    Creates a new color instance from the specified Red, Green and Blue components.

    • C#
    • VB.NET
    public Color CreateColor(int r, int g, int b)
    Public Function CreateColor(r As Integer, g As Integer, b As Integer) As Color
    Parameters
    r
    System.Int32

    The Red component (from 0 to 255).

    g
    System.Int32

    The Green component (from 0 to 255).

    b
    System.Int32

    The Blue component (from 0 to 255).

    Returns
    Color

    A new color instance from the specified Red, Green and Blue components.

    GetCollectionCount(Object)

    Gets the number of items contained in the collection.

    • C#
    • VB.NET
    public int GetCollectionCount(object collection)
    Public Function GetCollectionCount(collection As Object) As Integer
    Parameters
    collection
    System.Object

    The Collection-derived instance.

    Returns
    System.Int32

    The number of items contained in the collection.

    GetCollectionItem(Object, Int32)

    Gets the item at the specified index.

    • C#
    • VB.NET
    public object GetCollectionItem(object collection, int index)
    Public Function GetCollectionItem(collection As Object, index As Integer) As Object
    Parameters
    collection
    System.Object

    The Collection-derived instance.

    index
    System.Int32

    The zero-based index of the item to get.

    Returns
    System.Object

    The item at the specified index.

    Load(String)

    Loads a presentation from a file with the specified path.

    • C#
    • VB.NET
    public PresentationDocument Load(string path)
    Public Function Load(path As String) As PresentationDocument
    Parameters
    path
    System.String

    The path from which to load a presentation.

    Returns
    PresentationDocument

    A loaded presentation.

    Remarks

    File extension that is extracted from the path is used to create the appropriate LoadOptions derived class instance that is then passed to the Load(String, LoadOptions) method.

    Following file extensions are supported:

    • Microsoft PowerPoint: .pptx, .pptm, .ppsx, .ppsm, .potx, .potm
    Exceptions
    System.InvalidOperationException

    If file extension is not specified or not supported. If file extension is not recognized, use Load(String, LoadOptions) method overload instead.

    LoadWithOptions(String, Object)

    Loads a presentation from a file with the specified path.

    • C#
    • VB.NET
    public PresentationDocument LoadWithOptions(string path, object options)
    Public Function LoadWithOptions(path As String, options As Object) As PresentationDocument
    Parameters
    path
    System.String

    The path from which to load a presentation.

    options
    System.Object

    The loading options which can be used to define settings for load operation.

    Returns
    PresentationDocument

    A loaded presentation.

    RemoveCollectionItemAt(Object, Int32)

    Removes the item at the specified index of the collection.

    • C#
    • VB.NET
    public void RemoveCollectionItemAt(object collection, int index)
    Public Sub RemoveCollectionItemAt(collection As Object, index As Integer)
    Parameters
    collection
    System.Object

    The Collection-derived instance.

    index
    System.Int32

    The zero-based index of the item to remove.

    SaveWithOptions(Object, String, Object)

    Saves the presentation to a file with the specified path.

    • C#
    • VB.NET
    public void SaveWithOptions(object presentation, string path, object options)
    Public Sub SaveWithOptions(presentation As Object, path As String, options As Object)
    Parameters
    presentation
    System.Object

    The PresentationDocument instance which to save.

    path
    System.String

    The path to which to save the presentation.

    options
    System.Object

    The saving options which can be used to define settings for save operation.

    Examples

    Create, read, write PowerPoint files in Python
    Create, read, write PowerPoint files in PHP
    Create, read, write PowerPoint files in Classic ASP
    Open and read PowerPoint file in C# and VB.NET
    Create and write PowerPoint file in C# and VB.NET
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.

    OSZAR »