我正在使用 html-pdf 库将 html 转换为 PDF。我将我的 html 作为
<div id="newDiv" style="text-align: center;color:royalblue;">
<h1>
Welcome to {{ title }}!
</h1>
</div>
<button type="button" class="btn" (click)="showData()">Basic</button>
当我试图在该位置将其转换为 PDF 时在 Node 端。它给了我 PDF,但缺少样式。任何人都可以告诉我任何好的解决方案。从昨天开始就卡在这个
最佳答案
由于其中一个标签是 Angular,我建议使用 windows.print()。它适用于 Angular 5。
关于html - 将当前 HTML 页面转换为 PDF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55141180/