PresentationOperationsAgentTools Class
Provides AI agent tools for PowerPoint presentation manipulation operations. Handles merging and splitting of presentations.
Inheritance
Inherited Members
Namespace: Syncfusion.AI.AgentTools.PowerPoint
Assembly: Syncfusion.DocumentSDK.AI.AgentTools.dll
Syntax
public class PresentationOperationsAgentTools : AgentToolBase<IPresentation>
Constructors
PresentationOperationsAgentTools(DocumentStorageManager)
Initializes a new instance of the PresentationOperationsAgentTools class (Mode 2 — DocumentStorage).
Declaration
public PresentationOperationsAgentTools(DocumentStorageManager manager)
Parameters
| Type | Name | Description |
|---|---|---|
| DocumentStorageManager | manager | The document storage manager. |
PresentationOperationsAgentTools(PresentationManager)
Initializes a new instance of the PresentationOperationsAgentTools class (Mode 1 — InMemory).
Declaration
public PresentationOperationsAgentTools(PresentationManager manager)
Parameters
| Type | Name | Description |
|---|---|---|
| PresentationManager | manager | The presentation manager for managing PowerPoint presentations. |
Methods
ConvertPresentation(String, String, String)
Converts the document to the file system in the specified format (DocumentStorage mode only).
Declaration
[Tool(Name = "ConvertPresentation", Description = "Converts the presentation to the file system in the specified format. Works only in DocumentStorage mode. documentIdOrFilePath: The input file path from storage. Supported formats: PPTX, PPTM, POTX, POTM, MD.")]
public AgentToolResult ConvertPresentation([ToolParameter(Description = "The document ID (InMemory mode) or input file path (DocumentStorage mode).")] string documentIdOrFilePath, [ToolParameter(Description = "The file path to export to")] string filePath, [ToolParameter(Description = "The format: PPTX, PPTM, POTX, POTM, MD. Defaults to Pptx")] string formatType = "Pptx")
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | documentIdOrFilePath | |
| System.String | filePath | |
| System.String | formatType |
Returns
| Type |
|---|
| AgentToolResult |
ExportAsImage(String, String, String, Nullable<Int32>, Nullable<Int32>)
Declaration
[Tool(Name = "ExportAsImage", Description = "Exports PowerPoint presentation slides as images (PNG or JPEG) to the output directory. documentIdOrFilePath: The document ID (InMemory mode) or input file path (DocumentStorage mode). Optionally specify a slide range using startSlideIndex and endSlideIndex (1-based). Returns the file paths of the exported images.")]
public AgentToolResult ExportAsImage([ToolParameter(Description = "The document ID (InMemory mode) or input file path (DocumentStorage mode)")] string documentIdOrFilePath, [ToolParameter(Description = "The directory to save the exported image files")] string outputDirectory, [ToolParameter(Description = "The image format: Png or Jpeg. Defaults to Png")] string imageFormat = "Png", [ToolParameter(Description = "The 1-based start slide index. If null, starts from the first slide")] Nullable<int> startSlideIndex = null, [ToolParameter(Description = "The 1-based end slide index. If null, converts up to the last slide")] Nullable<int> endSlideIndex = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | documentIdOrFilePath | |
| System.String | outputDirectory | |
| System.String | imageFormat | |
| System.Nullable<System.Int32> | startSlideIndex | |
| System.Nullable<System.Int32> | endSlideIndex |
Returns
| Type |
|---|
| AgentToolResult |
GetMarkdown(String)
Gets the PowerPoint presentation content as Markdown.
Declaration
[Tool(Name = "GetMarkdown", Description = "Gets the PowerPoint presentation content as Markdown using the given documentId or filePath. Returns the Markdown content string of a PowerPoint presentation.")]
public AgentToolResult GetMarkdown([ToolParameter(Description = "The ID of the presentation or file path")] string documentIdOrFilePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | documentIdOrFilePath | The document ID (InMemory mode) or input file path (DocumentStorage mode). |
Returns
| Type | Description |
|---|---|
| AgentToolResult | Result containing the Markdown content string or an error message. |
ImportMarkdown(String, String, String)
Imports Markdown content into a PowerPoint presentation.
Declaration
[Tool(Name = "ImportMarkdown", Description = "Imports markdown content into a PowerPoint presentation. markdownContent / filePath: The markdown content as a string or the file path to a markdown file. documentIdOrFilePath: The document ID (InMemory mode) or input file path (DocumentStorage mode).")]
public AgentToolResult ImportMarkdown([ToolParameter(Description = "The markdown content as a string or the file path to a markdown file")] string markdownContentOrFilePath, [ToolParameter(Description = "The document ID (InMemory mode) or input file path (DocumentStorage mode) of the destination presentation")] string documentIdOrFilePath = null, [ToolParameter(Description = "Output file path for saving the result (DocumentStorage mode only).")] string outputFilePath = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | markdownContentOrFilePath | The markdown content as a string or the file path to a markdown file. |
| System.String | documentIdOrFilePath | The document ID (InMemory mode) or input file path (DocumentStorage mode) of the destination presentation. |
| System.String | outputFilePath | Output file path for saving the result (DocumentStorage mode only). |
Returns
| Type | Description |
|---|---|
| AgentToolResult | Result indicating success or failure. |
MergePresentations(String, String[], String, String)
Merges multiple PowerPoint presentations into a single destination presentation.
Declaration
[Tool(Name = "MergePresentations", Description = "Merges multiple PowerPoint Presentations into a single destination presentation. documentIdOrFilePath: The document ID (InMemory mode) or input file path (DocumentStorage mode) of the destination presentation.")]
public AgentToolResult MergePresentations([ToolParameter(Description = "The document ID (InMemory mode) or input file path (DocumentStorage mode) of the destination presentation")] string documentIdOrFilePath, [ToolParameter(Description = "A collection of document IDs or file paths to merge")] string[] sourceDocumentIds, [ToolParameter(Description = "Paste option: 'SourceFormatting' (default) or 'UseDestinationTheme'")] string pasteOption = "SourceFormatting", [ToolParameter(Description = "Output file path for saving the result (DocumentStorage mode only).")] string outputFilePath = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | documentIdOrFilePath | |
| System.String[] | sourceDocumentIds | Array of source document IDs or file paths to merge. |
| System.String | pasteOption | Paste option for formatting: 'SourceFormatting' or 'UseDestinationTheme'. Default is 'SourceFormatting'. |
| System.String | outputFilePath | Output file path for saving the result (DocumentStorage mode only). |
Returns
| Type | Description |
|---|---|
| AgentToolResult | Result indicating success or failure. |
SplitPresentation(String, String, String, String)
Splits a single PowerPoint presentation into multiple presentations based on split rules.
Declaration
[Tool(Name = "SplitPresentation", Description = "Splits a single PowerPoint presentation into multiple presentations based on the specified splitRules (sections, layout type, or slide numbers (e.g., '1,3,5')). documentIdOrFilePath: The document ID (InMemory mode) or input file path (DocumentStorage mode).")]
public AgentToolResult SplitPresentation([ToolParameter(Description = "The document ID (InMemory mode) or input file path (DocumentStorage mode)")] string documentIdOrFilePath, [ToolParameter(Description = "Split rules: 'sections', 'layout', or slide numbers (e.g., '1,3,5')")] string splitRules, [ToolParameter(Description = "Paste option: 'SourceFormatting' (default) or 'UseDestinationTheme'")] string pasteOption = "SourceFormatting", [ToolParameter(Description = "Output file path prefix for saving the split results (DocumentStorage mode only). Index will be appended, e.g. 'output_split_1.pptx'.")] string outputFilePath = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | documentIdOrFilePath | |
| System.String | splitRules | Split rules: 'sections', 'layout', or specific slide numbers (e.g., '1,3,5'). |
| System.String | pasteOption | Paste option for formatting: 'SourceFormatting' or 'UseDestinationTheme'. Default is 'SourceFormatting'. |
| System.String | outputFilePath | Output file path for saving the result (DocumentStorage mode only). |
Returns
| Type | Description |
|---|---|
| AgentToolResult | Result containing array of document IDs of the split presentations. |
Remarks
Split by specific slide numbers (1-based). The provided numbers define split boundaries � each number marks the last slide of a group. Remaining slides after the last boundary form an additional group.