简体   繁体   English

如何将由AngularJs动态生成的HTML页面导出为PDF?

[英]How do I export my HTML page which is dynamically generated by AngularJs as PDF?

I have tested JavaScript library jsPDF for a exporting a complete page to pdf and downloading the same. 我已经对JavaScript库jsPDF进行了测试,以将完整的页面导出为pdf并下载。 Wasn't really happy with the format of elements that has an overflow which I have handled through CSS. 我对通过CSS处理的溢出元素的格式不是很满意。 But seems to get the basic work dome. 但是似乎得到了基本的工作。 Also has some issues if i assign it to onload event. 如果我将其分配给onload事件,也会有一些问题。 The page gets stuck and browser stops responding. 页面卡住,浏览器停止响应。

The Kendo library seem to do an Ok job for me clientside but you do get some rendering issues now and then. Kendo库似乎对我的客户端工作还不错,但是您确实会时不时遇到一些渲染问题。

You will get the best results from a server side rendering library. 您将从服务器端渲染库中获得最佳结果。 You can scrape the HTML from the DOM and send it server side to a rendering engine like ABCPDF and the results are usually pretty good. 您可以从DOM抓取HTML,并将其发送到服务器端到ABCPDF之类的呈现引擎,结果通常都很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何触发页面上多个动态生成的ID的fitVid? - How do I trigger fitVids for multiple, dynamically generated ids on a page? 当内部HTML由Javascript函数生成时,如何获取页面一部分的innerHTML? - How do I get the innerHTML of a part of my page when that inner HTML is generated by a Javascript function? 如何在JavaScript中创建一个对象,该对象动态创建一个div(具有样式属性和id)并追加到我的html页面? - How do I create an object in JavaScript, that dynamically creates a div (with style properties and an id) and appends to my html page? 如何更改Docco生成的HTML页面的标题? - How do I change the title of an HTML page generated by Docco? 如何打印使用 jquery 动态生成的 HTML 页面 - How do I print a HTML page dynamicly generated with jquery 如何将 Nextjs 页面导出为 pdf? - How can I export a Nextjs page as pdf? AngularJS 变量没有显示在我的 HTML 页面上 - AngularJS variables do not show on my HTML page 如何在AngularJS中将控制器动态绑定到生成的HTML页面? - How to bind controllers to generated HTML pages dynamically in AngularJS? 将 HTML 页面导出到 angular 中的 pdf - Export HTML page to pdf in angular 如何一直向下滚动我动态生成的 HTML 页面并从顶部再次开始滚动? - How to scroll my dynamically generated HTML Page all the way down and start scrolling again from the top?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM