Methods
(async) WDocx2pdf(fpIn, fpOut, optopt) → {Promise}
- Description:
docx2pdf docx檔轉pdf檔
- Source:
Example
import WDocx2pdf from './src/WDocx2pdf.mjs'
//import WDocx2pdf from 'w-docx2pdf/src/WDocx2pdf.mjs'
//import WDocx2pdf from 'w-docx2pdf'
async function test() {
let fpIn = `./test/ztmp.docx`
let fpOut = `./test/ztmp.pdf`
let opt = {}
let r = await WDocx2pdf(fpIn, fpOut, opt)
console.log(r)
// => ok
w.fsDeleteFile(fpOut)
}
test()
.catch((err) => {
console.log('catch', err)
})
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fpIn |
String | 輸入來源docx檔位置字串 |
||||||||||||||||||||||
fpOut |
String | 輸入轉出pdf檔位置字串 |
||||||||||||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳Promise,resolve回傳成功訊息,reject回傳錯誤訊息
- Type
- Promise