简体   繁体   English

将我的 SharePoint aspx 页面导出为 PDF 文件

[英]Export my SharePoint aspx page to a PDF file

I am working on an enterprise wiki site collection , and using the SharePoint designer I have manually added a link named “Print to PDF” as follow:-我正在处理企业 wiki 网站集,并使用 SharePoint 设计器手动添加了一个名为“打印到 PDF”的链接,如下所示:-

在此处输入图片说明

But I am trying to implement the link functionalities, so when the user clink on the link, the page content (mainly any html components that are inside the rich text ) should be displayed inside a pdf file?但是我正在尝试实现链接功能,所以当用户点击链接时,页面内容(主要是富文本中的任何 html 组件)应该显示在 pdf 文件中?

Can anyone advice how I can achieve this ,, can I write a javaScript code which can do the work ?任何人都可以建议我如何实现这一点,我可以编写一个可以完成这项工作的 javaScript 代码吗? Thanks谢谢

You can develop an ASPX page (actually preferably an ASHX handler) that does the work for you by accepting an URL to convert, which you then pass into a third party HTML to PDF library.您可以开发一个 ASPX 页面(实际上最好是一个 ASHX 处理程序),通过接受要转换的 URL 来为您完成工作,然后您将其传递给第三方 HTML 到 PDF 库。 The generated PDF file can then be returned to the user's browser.然后可以将生成的 PDF 文件返回到用户的浏览器。

Alternatively, have a look at this blog post ( that I wrote, so big fat disclaimer about me being biased ) that shows how you can buy a product off the shelf that does all the work for you.或者,看看这篇博客文章我写的,关于我有偏见的免责声明如此之大),它展示了如何购买现成的产品,为您完成所有工作。

You can read more about it here .您可以在此处阅读更多相关信息

BTW, for questions related to SharePoint you may want to consider using sharepoint.stackexchange.com .顺便说一句,对于与 SharePoint 相关的问题,您可能需要考虑使用sharepoint.stackexchange.com

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM