Convert various document formats to Markdown using the zerox library and GPT-4o vision.
For small files (< 30 seconds):
node {baseDir}/scripts/convert.mjs <filePath> [outputPath]
# Convert PDF - saves to {baseDir}/output/document.md by default
node {baseDir}/scripts/convert.mjs "/path/to/document.pdf"
# Convert PDF with custom output path
node {baseDir}/scripts/convert.mjs "/path/to/document.pdf" "/path/to/output.md"
# Convert Word document - saves to {baseDir}/output/document.md
node {baseDir}/scripts/convert.mjs "/path/to/document.docx"
For large files or scanned PDFs that take minutes:
node {baseDir}/scripts/convert-bg.mjs <filePath> [outputPath]
{baseDir}/output/convert-bg.log# Convert large scanned PDF in background
node {baseDir}/scripts/convert-bg.mjs "/path/to/scanned-document.pdf"
# Monitor progress
tail -f {baseDir}/output/convert-bg.log
APIYI_API_KEY: Your OpenAI-compatible API key (environment variable)共 1 个版本