Skip to content

YLDJack/html2pdf_word

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published