简体   繁体   English

我需要从 ASP.NET 网络表单中的用户控件 HTML 创建 PDF 吗? 如何从用户控制中获取 html,然后将 HTML 转换为 PDF?

[英]I need to create PDF from user control HTML in ASP.NET webforms ? How do i get html from user control and then convert that HTML to PDF?

The purpose of this is working on ASP.NET webform application.这样做的目的是在 ASP.NET 网络表单应用程序上工作。 My requirement is to get user control rendered html and then convert that html to pdf and attach as a document in database.我的要求是让用户控制呈现 html,然后将 html 转换为 pdf 并作为文档附加到数据库中。 I have used multiple techniques like getting html from http web request but could not found my desired solution.我使用了多种技术,例如从 http web 请求获取 html ,但找不到我想要的解决方案。 Any help would be really appreciated.任何帮助将非常感激。

You could look at the OpenHtmlToPdf你可以看看 OpenHtmlToPdf

https://github.com/vilppu/OpenHtmlToPdf https://github.com/vilppu/OpenHtmlToPdf

I think it will do what you need.我认为它会做你需要的。

You will create the PDF and save it as a blob within your database is my understanding of your requirement.您将创建 PDF 并将其保存为数据库中的 blob,这是我对您的要求的理解。

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

相关问题 将值从HTML控件复制到ASP.NET用户控件 - Copy value from HTML controls to ASP.NET user control ASP.NET / DotNetNuke - 将HTML从用户控件添加到正文 - ASP.NET / DotNetNuke - Prepend HTML to the body from of a User Control 在ASP.NET中使用itextsharp将HTML字符串转换为pdf - Convert from html string to pdf using itextsharp in asp.net 如何防止最终用户更改 asp.net 内核中 html 标签的值? - how do I prevent end-user to change values from html tags in asp.net core? 如何生成PDF并加载ASCX asp.net用户控件的内容? - How can I generate a PDF and load the contents of an ASCX asp.net user control? 如何从 ASP.NET 用户控件中的父页面访问控件? - How do I access controls from the parent page from within an ASP.NET User Control? 如何从ASP.NET网站(而不是Web应用程序)中的用户控件获取父页面 - How can I get the parent page from a User Control in an ASP.NET Website (not Web Application) ASP.Net-以转义的形式返回用户控件html \\ text - ASP.Net - Return user control html\text as escaped 如何在ASP.NET WebForms中用用户控件替换字符串? - How to replace string with User Control in ASP.NET WebForms? Asp.Net WebForms-如何将ViewData作为参数传递给用户控件 - Asp.Net WebForms - How to pass ViewData as param to User Control
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM