PdfDocumentManager Class
Manager for handling PDF documents in memory during AI agent operations. Provides document lifecycle management with automatic cleanup. Supports both new PDF documents and loaded existing PDFs.
Implements
Inherited Members
Namespace: Syncfusion.AI.AgentTools.PDF
Assembly: Syncfusion.DocumentSDK.AI.AgentTools.dll
Syntax
public class PdfDocumentManager : DocumentManagerBase<PdfDocumentBase>, IDocumentManager
Constructors
PdfDocumentManager(Nullable<TimeSpan>)
Initializes a new instance of the PdfDocumentManager class.
Declaration
public PdfDocumentManager(Nullable<TimeSpan> expirationTime = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.TimeSpan> | expirationTime | Time before documents are automatically cleaned up. Default is 30 minutes. |
Properties
DocumentIdPrefix
Gets the prefix used for generating unique PDF document identifiers.
Declaration
protected override string DocumentIdPrefix { get; }
Property Value
| Type | Description |
|---|---|
| System.String | The prefix string "pdf_" used for PDF document IDs. |
Overrides
DocumentType
Gets the document type managed by this manager.
Declaration
public override DocumentType DocumentType { get; }
Property Value
| Type | Description |
|---|---|
| DocumentType | DocumentType.PDF indicating this manager handles PDF documents. |
Overrides
Methods
CloseDocument(PdfDocumentBase)
Closes and releases the resources associated with the PDF document.
Declaration
protected override void CloseDocument(PdfDocumentBase document)
Parameters
| Type | Name | Description |
|---|---|---|
| PdfDocumentBase | document | The PdfDocumentBase instance to close. |
Overrides
CreateDocumentInstance()
Creates a new empty PDF document instance.
Declaration
protected override PdfDocumentBase CreateDocumentInstance()
Returns
| Type | Description |
|---|---|
| PdfDocumentBase | A new PdfDocument instance ready for editing. |
Overrides
Dispose()
Disposes the PDF Document Manager and all managed documents.
Declaration
public void Dispose()
ExportDocumentInstance(PdfDocumentBase, String)
Exports the PDF document to the specified file path.
Declaration
protected override void ExportDocumentInstance(PdfDocumentBase document, string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| PdfDocumentBase | document | The PdfDocumentBase instance to export. |
| System.String | filePath | The file path where the document will be saved. |
Overrides
ImportDocumentInstance(String)
Imports an existing PDF document from the specified file path.
Declaration
protected override PdfDocumentBase ImportDocumentInstance(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | The file path to the PDF document to load. |
Returns
| Type | Description |
|---|---|
| PdfDocumentBase | A PdfLoadedDocument instance loaded from the specified file. |
Overrides
ImportDocumentInstance(String, String)
Imports an encrypted PDF document from the specified file path using the provided password.
Declaration
protected override PdfDocumentBase ImportDocumentInstance(string filePath, string password)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | The file path to the encrypted PDF document. |
| System.String | password | The password required to open the encrypted document. |
Returns
| Type | Description |
|---|---|
| PdfDocumentBase | A PdfLoadedDocument instance loaded from the specified file with decryption applied. |