Skip to content

About

Covert Html to PDF or Word File

Resources

Stars

3 stars

Watchers

2 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

Uasge✨

Covert Html to PDF or Word File

Install 📦

npm install html2pdf_word -s

Arguments🔨

参数名(按顺序排列) 说明 类型 是否必填 默认值
domId 需转换的DOM的Id或className(开头带有'#'或'.') string 是 无
fileName 转换后的文件名 string 是 无
fileType 转换后文件类型('PDF'|'Word') string 否 'PDF'
title 转换后的文件中的标题 string 否 无
subTitle 转换后的文件中的副标题 string 否 无
font 转换后的文件的标题字体(目前‘黑体’|‘楷体’) string 否 ‘黑体’

Examples📐

1.Import function from package

        import htmlToPDForWord from 'html2pdf_word'

2.Use it

          htmlToPDForWord('.chart-boxs','文件名','PDF','标题','副标题','楷体');

PDF (1)

Future work🌈

  • 1、添加更多的可选字体
  • 2、可自由调整标题和副标题大小
  • 3、可自由调整文字居中位置
  • 4、优化项目结构和体积

About

Covert Html to PDF or Word File

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages