ASPOSE WORDS CLOUD API USAGE SYNOPSIS
OVERVIEW
A Node.js application that uses the Aspose Words Cloud API to generate redlined contract documents with track changes and comments. The system processes legal contract reviews and applies suggested edits to DOCX files.
KEY ASPOSE API COMPONENTS USED
- File Operations
- Upload: UploadFileRequest - Uploads original DOCX files to Aspose cloud storage
- Download: DownloadFileRequest - Downloads processed documents
- Files are managed with paths like “original.docx”, “revised.docx”, “redlined.docx”
- Text Search and Replacement
- Search: SearchRequest with pattern matching to locate text in documents
- Replace: ReplaceTextRequest with ReplaceTextParameters for text modifications
- Applies various edit operations: replace, delete, insert_before, insert_after
- Document Comparison
- Compare: CompareDocumentRequest with CompareData to generate track changes
- Compares original vs revised documents to create redlined output
- Uses FileReference.fromRemoteFilePath() for document references
- Comment Insertion
- Insert Comments: InsertCommentRequest with CommentInsert objects
- Position Targeting: PositionInsideNode with nodeId and offset for precise placement
- Document Structure: GetParagraphsRequest to retrieve paragraph node IDs
WORKFLOW PROCESS
- Document Upload: Original DOCX uploaded via UploadFileRequest
- Text Location: Uses SearchRequest to find specific text excerpts in the document
- Text Modifications: Applies edits using ReplaceTextRequest to create revised version
- Document Comparison: Uses CompareDocumentRequest to generate track changes between original and revised
- Comment Addition: Inserts review comments at specific locations using InsertCommentRequest
- Final Download: Retrieves processed document via DownloadFileRequest
For some reason, it used tens of API calls per edit, resulting in billing charges around $600. We only tested the API and never took it to production