3

js 生成中文 PDF 有啥好办法?

 2 years ago
source link: https://www.v2ex.com/t/810128
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  JavaScript

js 生成中文 PDF 有啥好办法?

  jatsz2020 · 1 小时 21 分钟前 · 191 次点击
html2pdf 支持中文,html 排版,但是生成的 PDF 是图片的,无法复制里面的文字jspdf 搞了好久无法支持中文,然后前端加载一个几十兆的字体也麻烦
3 条回复    2021-10-24 13:16:25 +08:00

codehz

codehz   1 小时 12 分钟前 via Android

要支持矢量化中文就必须得自己提供字体。。。浏览器的 api 只能糊成像素的(

binux

binux   1 小时 8 分钟前 via Android

@codehz 理论上讲完全可以,文字是图片的,但是可以复制。

MonikaCeng

MonikaCeng   12 分钟前 via Android

我之前用 windows 服务器,用了一个.exe 文件,php 命令行调用它去将网页转 pdf ,中文,文本可复制,链接可点击。linux 应该这种插件更多

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK