alexa
menu

Document Processing

    Show / Hide Table of Contents

    OfficeToPdfAgentTools Class

    Provides AI agent tools for converting Office documents (Word, Excel, PowerPoint) to PDF format. Handles the conversion workflow by retrieving documents from their respective managers, performing the conversion, and storing the result in the PDF manager.

    Inheritance
    System.Object
    AgentToolBase
    AgentToolBase<PdfDocumentBase>
    OfficeToPdfAgentTools
    Inherited Members
    AgentToolBase<PdfDocumentBase>.InMemoryManager
    AgentToolBase<PdfDocumentBase>.Mode
    AgentToolBase<PdfDocumentBase>.OpenDocument(String, String)
    AgentToolBase<PdfDocumentBase>.SaveDocument(String, PdfDocumentBase)
    AgentToolBase<PdfDocumentBase>.SaveFile(String, Stream)
    AgentToolBase<PdfDocumentBase>.StorageManager
    AgentToolBase.GetTools()
    Namespace: Syncfusion.AI.AgentTools.OfficeToPDF
    Assembly: Syncfusion.DocumentSDK.AI.AgentTools.dll
    Syntax
    public class OfficeToPdfAgentTools : AgentToolBase<PdfDocumentBase>

    Constructors

    OfficeToPdfAgentTools(DocumentManagerCollection, String)

    Initializes a new instance of the OfficeToPdfAgentTools class (Mode 1 — InMemory).

    Declaration
    public OfficeToPdfAgentTools(DocumentManagerCollection managerCollection, string outputDirectory = null)
    Parameters
    Type Name Description
    DocumentManagerCollection managerCollection

    The collection of document managers.

    System.String outputDirectory

    Optional output directory for temporary files. If null or empty, uses current directory.

    OfficeToPdfAgentTools(DocumentStorageManager)

    Initializes a new instance of the OfficeToPdfAgentTools class (Mode 2 — DocumentStorage).

    Declaration
    public OfficeToPdfAgentTools(DocumentStorageManager manager)
    Parameters
    Type Name Description
    DocumentStorageManager manager

    The document storage manager.

    Methods

    ConvertToPdf(String, String, String)

    Converts an Office document (Word, Excel, or PowerPoint) to PDF format. The source document must already exist in its respective manager. The resulting PDF is stored in the PDF manager for further operations.

    Declaration
    [Tool(Name = "ConvertToPdf", Description = "Converts an Office document (Word, Excel, or PowerPoint) to PDF format. sourceDocumentIdOrFilePath: The document ID (InMemory mode) or input file path (DocumentStorage mode). Returns the PDF document ID.")]
    public AgentToolResult ConvertToPdf([ToolParameter(Description = "The document ID (InMemory mode) or input file path (DocumentStorage mode) of the source document")] string sourceDocumentIdOrFilePath, [ToolParameter(Description = "The type of source document: Word, Excel, or PowerPoint")] string sourceType, [ToolParameter(Description = "Output file path for saving the result (DocumentStorage mode only).")] string outputFilePath = null)
    Parameters
    Type Name Description
    System.String sourceDocumentIdOrFilePath

    The document ID (InMemory mode) or input file path (DocumentStorage mode) of the source document.

    System.String sourceType

    The type of source document: "Word", "Excel", or "PowerPoint".

    System.String outputFilePath

    Output file path for saving the result (DocumentStorage mode only).

    Returns
    Type Description
    AgentToolResult

    Result containing the generated PDF document ID.

    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved