开发者

From HTML form to PDF

开发者 https://www.devze.com 2023-02-24 03:59 出处:网络
Is there an easy way to have an HTML form on a webpage that, when the user submits, puts the data into a PDF file and sends it to the receiver?

Is there an easy way to have an HTML form on a webpage that, when the user submits, puts the data into a PDF file and sends it to the receiver?

The webpage is runnin开发者_JAVA百科g on .net.

Thanks


Umbraco has a good PDF generator package called "XSL to PDF".

It wil allow you to generate a PDF file from Umbraco just by defining a PDF template.

Using this you should be able to achieve what you are looking for.


If you have C# use one of this libraries : http://csharp-source.net/open-source/pdf-libraries

(I don't use dot net, so I can't really recommend any, sorry)


I have been using PDFsharp a lot.. Does the job!


Have you tried "PDF Vision .Net"? It's a commercial library but the costs of paying justify itself :) Only $150. I think you should try it.

Use this code for the HTML to PDF converting in Asp .NET/C#:

        SautinSoft.PdfVision obj  = new SautinSoft.PdfVision();
    obj.PageStyle.PageSize.A4();
    byte [] pdf = obj.ConvertHtmlFileToPDFStream(@"http://www.somesite.com");
    if (pdf!= null)
    {
        Response.Buffer = true;
        Response.Clear();
        Response.ContentType = "application/PDF";
        Response.AddHeader("Content-Disposition:", "attachment; filename=Result.pdf");
        Response.BinaryWrite(pdf);
        Response.Flush();
        Response.End();


Disclaimer: I'm working for this company.

I can also mention another great product of Sautinsoft company. I think you should check them both and then choose the best! The library quite well doing their job and doesn't require any additional components.

PDF Metamorphosis .Net

This component

HTML to PDF in C#:

SautinSoft.PdfMetamorphosis p = new SautinSoft.PdfMetamorphosis();
p.PageStyle.PageSize.A4();
p.HtmlToPdfConvertFile(@"c:\table.html", @"c:\Result.pdf");
0

精彩评论

暂无评论...
验证码 换一张
取 消