Openai Document
01README
OpenAI-powered document processing for .pptx and .docx — analyze structure, enhance text while preserving formatting, generate from templates, and design pixel-perfect PDFs from natural-language instructions via headless Chromium. Vault-based API key.
02Release Notes
Add curated README and LICENSE to tarball (additionalFiles), bringing extension's Swamp Club quality grade from F/B to A-/B.
03Models
@dougschaefer/openai-documentv2026.04.17.2openai-document/document.ts
fn analyze(filePath: string, outputName: string)
Parse a .pptx or .docx file and return its structure, sections, and text content.
| Argument | Type | Description |
|---|---|---|
| filePath | string | Absolute path to the .pptx or .docx file |
| outputName | string |
fn design(instructions: string, contentSource?: string, context?: string, outputName: string)
Design a professional document as PDF. GPT generates complete HTML with inline CSS based on your design instructions and content, then headless Chromium renders it to a pixel-perfect PDF. Supports designing from scratch, from a content description, or from an existing .docx file's extracted content.
| Argument | Type | Description |
|---|---|---|
| instructions | string | Design and content direction — describe the visual style, layout, colors, and what content to include. E.g., 'Modern proposal for Snap Inc, Kentucky blue and white color scheme, clean layout with geometric accents, two-column sections where appropriate. Cover page with large color block and company name.' |
| contentSource? | string | Optional: absolute path to a .docx file to extract content from. The design method will pull the text and restructure it into the new design. If omitted, GPT generates content based on instructions alone. |
| context? | string | Additional context — company info, client details, scope data, brand guidelines, etc. |
| outputName | string |
fn enhance(filePath: string, instructions: string, model: enum, outputName: string)
Enhance or modify text content of a .pptx or .docx using GPT, preserving formatting and design.
| Argument | Type | Description |
|---|---|---|
| filePath | string | Absolute path to the .pptx or .docx file |
| instructions | string | What to change in the text content |
| model | enum | |
| outputName | string |
fn generate(templatePath: string, instructions: string, context?: string, model: enum, outputName: string)
Generate a new document from a .docx/.pptx template by populating placeholders with GPT-generated content.
| Argument | Type | Description |
|---|---|---|
| templatePath | string | Absolute path to the template .pptx or .docx file |
| instructions | string | What content to generate |
| context? | string | Additional context |
| model | enum | |
| outputName | string |
Resources
analysis(infinite)— Parsed document structure and content
document(infinite)— Designed, generated, or enhanced document file
04Previous Versions
2026.04.27.1Apr 27, 2026
Initial release. Four methods: analyze (parse .pptx/.docx structure), enhance (rewrite text preserving formatting), generate (populate templates with GPT content), design (generate pixel-perfect PDFs from natural-language instructions via headless Chromium).
05Stats
A
100 / 100
Downloads
0
Archive size
73.2 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types1/1earned
- Has description1/1earned
- At least one platform tag (or universal)1/1earned
- Two or more platform tags (or universal)1/1earned
- License declared1/1earned
- Verified public repository2/2earned
06Platforms
07Labels