feat: конвертация бинарного .doc (Word 97-2003) в PDF (POI HWPF + FOP)

This commit is contained in:
Pjandro
2026-10-16 21:44:24 +00:00
parent 4d6cc2a795
commit 96865daef4
16 changed files with 1239 additions and 56 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ export async function convertDocx(
// флаг i обязателен; фолбэк — имя исходника с заменой расширения
const cd = resp.headers.get('Content-Disposition') ?? ''
const m = /filename\*=utf-8''([^;]+)/i.exec(cd)
const filename = m ? decodeURIComponent(m[1]) : file.name.replace(/\.docx$/i, '') + '.pdf'
const filename = m ? decodeURIComponent(m[1]) : file.name.replace(/\.docx?$/i, '') + '.pdf'
const blob = await resp.blob()
return { blob, filename }
}