Adds a DocBlock component that renders embedded documents, new export buttons for DOCX and PDF, and updates the file‑upload picker to accept *.txt, *.docx, *.pptx, and *.pdf. Introduces a DOCX→PDF conversion bridge in the backend and new /tts and /asr endpoints that expose TTS and speech‑recognition functionality. The README is rewritten to describe the new features and clean up legacy documentation. All changes are backward‑compatible and do not introduce breaking API changes.
21 lines
451 B
JavaScript
21 lines
451 B
JavaScript
const path = require('path')
|
|
const { convert } = require('docx2pdf-converter')
|
|
|
|
function main() {
|
|
const inputPath = process.argv[2]
|
|
const outputPath = process.argv[3]
|
|
|
|
if (!inputPath || !outputPath) {
|
|
throw new Error('缺少 DOCX 或 PDF 路径')
|
|
}
|
|
|
|
convert(path.resolve(inputPath), path.resolve(outputPath))
|
|
}
|
|
|
|
try {
|
|
main()
|
|
} catch (error) {
|
|
console.error(error instanceof Error ? error.message : String(error))
|
|
process.exit(1)
|
|
}
|