pdfmake
约 1 分钟阅读
- bpampuch/pdfmakeGitHubbpampuch/pdfmakebpampuch/pdfmake · MIT, JS · 使用 pdfkit, xmldoc 生成 PDF · 图片只支持 JPEG 和 PNG 格式 · 因为 pdfkit 只支持这两种格式 https://pdfkit.org/docs/images.html笔记:pdfmake
- MIT, JS
- 使用 pdfkit, xmldoc 生成 PDF
- 图片只支持 JPEG 和 PNG 格式
- 因为 pdfkit 只支持这两种格式 pdfkit.org/docs/images.html
// PdfPrinter 用于 Node.js
import PdfPrinter from 'pdfmake';
// createPdf 用于浏览器
import createPdf from 'pdfmake/build/pdfmake';
// 文档内容
import type { TDocumentDefinitions } from 'pdfmake/interfaces';export type Content =
| string // =ContentText
| number
| Content[] // =ContentStack
| ContentText
| ContentColumns
| ContentStack
| ContentUnorderedList
| ContentOrderedList
| ContentTable
| ContentAnchor
| ContentPageReference
| ContentTextReference
| ContentToc
| ContentTocItem
| ContentImage
| ContentSvg
| ContentQr
| ContentCanvas;FAQ
内存问题
- 关闭 fontLayoutCache
- 拆分为多个 pdf 然后合并
- bpampuch/pdfmake#1052GitHub Issuebpampuch/pdfmake#1052
- bpampuch/pdfmake#2540GitHub Issuebpampuch/pdfmake#2540
关联信息
反向链接、本文链接的其他页面和外部资料。
参考资料
GitHub3 条
- bpampuch/pdfmakegithub.com/bpampuch/pdfmake
- bpampuch/pdfmake#1052github.com/bpampuch/pdfmake/issues/1052
- bpampuch/pdfmake#2540github.com/bpampuch/pdfmake/issues/2540
其他外链1 条
- pdfkit.org/docs/images.htmlpdfkit.org/docs/images.html