2018年3月14日 星期三

[研究][C#][ASP.NET] SelectPdf 社群版 - 免費 HTML to PDF v17.3.0 的 Url to Pdf 試用 (NuGet 安裝)

[研究][C#][ASP.NET][WebForm] SelectPdf Community Edition - Free HTML to PDF for .NET v17.3.0 的 Url to Pdf 試用 (NuGet 安裝)

2018-03-14

注意,免費的社群版只能建立5頁 pdf 。

Community Edition - Free HTML to PDF for .NET | SelectPdf.com
https://selectpdf.com/community-edition/

SelectPdf Html To Pdf Converter for .NET – Community Edition

Select.Pdf offers a Community Edition (FREE) of the powerful Html To Pdf Converter for .NET that can be found in the full featured pdf library Select.Pdf for .NET. The free html to pdf converter offers most of the features the professional sdk offers, the only notable limitation is that it can only generate pdf documents up to 5 pages long.

FREE HTML TO PDF FOR .NET
  • Convert any url or html file to pdf
  • Convert any raw html code to pdf
  • No external dependencies
  • Powerful Javascript engine
  • HTML5/CSS3 support
  • Customizable headers and footers
LIVE DEMO C#
https://selectpdf.com/html-to-pdf/demo/

ONLINE DOCUMENTATION
https://selectpdf.com/html-to-pdf/docs/

商業版本價格
https://selectpdf.com/pricing/
Single Developer License – $499 – Buy now (1 developer, 1 deployment machine)
5-Developers License – $799 – Buy now (up to 5 developers, up to 10 deployment machines)
Enterprise License – $1,199 – Buy now (unlimited developers, up to 100 deployment machines)

https://selectpdf.com/html-to-pdf/demo/
商業版 比 社群版 多的功能:
- Create PDF documents with more than 5 pages. (社群版只能建立最多 5 頁的 pdf )
- Convert only a certain section of the page, specified by the html element ID.
- Manually start the conversion to PDF from javascript.
- Specify a JS startup script that will run before the conversion.
- Hide parts of the web page during the html to pdf conversion.
- Load and modify existing PDF documents.
- Add additional HTML, text, images to PDF (using PdfHtmlElement, PdfTextElement, PdfImageElement objects).
- Get web elements location in PDF.
- Specify the open action of the PDF document (jump to page, run script).
- Custom headers and footers on specific PDF pages.
- Form fields filling.
- PDF portfolios management.
- Resize/scale content of existing PDF documents.
- Extract text from PDF (PDF to Text converter).
- Search for text in PDF.
- Convert PDF pages to images (PDF to Image converter).

官方範例
GitHub - selectpdf/selectpdf-free-html-to-pdf-converter: Free Html To Pdf Converter for .NET. Asp.Net, C# sample.
https://github.com/selectpdf/selectpdf-free-html-to-pdf-converter














Thank you for using Select.Pdf Html To Pdf Converter for .NET - Community Edition.

Online demo C#: https://selectpdf.com/html-to-pdf/demo/
Online demo Vb.Net: https://selectpdf.com/html-to-pdf/demo-vb/
Online documentation: https://selectpdf.com/html-to-pdf/docs/


With Select.Pdf is very easy to convert any web page to a pdf document. The code is as simple as this:

            SelectPdf.HtmlToPdf converter = new SelectPdf.HtmlToPdf();
            SelectPdf.PdfDocument doc = converter.ConvertUrl("http://selectpdf.com");
            doc.Save("test.pdf");
            doc.Close();

IMPORTANT: Please note that THIS IS NOT A FREE TRIAL of our commercial library. This is a different, FREE product, that contains less features than the full library.
If you want to test our full SelectPdf Library for .NET use one of the following urls:

https://selectpdf.com/pdf-library-for-net/
https://www.nuget.org/packages/Select.Pdf/

For complete product information, take a look at https://selectpdf.com.
For support, contact us at support@selectpdf.com.



參考
SelectPdf Free Html To Pdf Converter - Convert from Url to Pdf - C# / ASP.NET Sample
https://selectpdf.com/html-to-pdf/demo/convert-url-to-pdf.aspx

Default.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SelectPDF_UrltoPdf.Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>

            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />

        </div>
    </form>
</body>
</html>


Default.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SelectPdf;

namespace SelectPDF_UrltoPdf
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            // read parameters from the webpage
            string url = "http://www.hinet.net/";

            string pdf_page_size = "A4";
            PdfPageSize pageSize = (PdfPageSize)Enum.Parse(typeof(PdfPageSize),
                pdf_page_size, true);

            string pdf_orientation = "Portrait";    // or     Landscape
             PdfPageOrientation pdfOrientation =
                (PdfPageOrientation)Enum.Parse(typeof(PdfPageOrientation),
                pdf_orientation, true);

            int webPageWidth = 1024;
            int webPageHeight = 0;

            // instantiate a html to pdf converter object
            HtmlToPdf converter = new HtmlToPdf();

            // set converter options
            converter.Options.PdfPageSize = pageSize;
            converter.Options.PdfPageOrientation = pdfOrientation;
            converter.Options.WebPageWidth = webPageWidth;
            converter.Options.WebPageHeight = webPageHeight;

            // create a new pdf document converting an url
            PdfDocument doc = converter.ConvertUrl(url);

            // save pdf document
            doc.Save(Response, false, "Sample.pdf");

            // close pdf document
            doc.Close();
        }
    }
}






用下面網址做測試
https://docs.microsoft.com/zh-tw/dotnet/framework/whats-new/

免費的社群版最多只能顯示 5 頁完整的,第6頁中間就沒了。


(完)

相關

[研究][C#][ASP.NET] 試用 Free Spire.PDF for .NET 建立 pdf 檔案 (NuGet 安裝)
http://shaurong.blogspot.com/2018/03/aspnet-free-spirepdf-for-net-pdf.html

[研究][C#][ASP.NET] SelectPdf 社群版 - 免費 HTML to PDF v17.3.0 的 Url to Pdf 試用 (NuGet 安裝)
http://shaurong.blogspot.com/2018/03/caspnet-selectpdf-html-to-pdf-url-to-pdf.html

[研究][C#][ASP.NET] iTextSharp v7.1.1 產生 pdf 試用 (NuGet 安裝)
http://shaurong.blogspot.com/2018/03/caspnet-itextsharp-v711-pdf-nuget.html

[研究][C#][ASP.NET] iTextSharp v5.5.13 產生 pdf 試用 (NuGet 安裝)
http://shaurong.blogspot.com/2018/03/caspnet-itextsharp-v5513-pdf-nuget.html

[研究][C#][ASP.NET] 免費 PDFsharp v1.32.3057.0 產生 pdf 試用 (NuGet 安裝)
http://shaurong.blogspot.com/2018/03/caspnet-pdfsharp-v13230570-pdf-nuget.html

Convert from HTML to PDF in CSharp VB and ASP.NET with a Free 3rd Party Library
https://code.msdn.microsoft.com/Convert-from-HTML-to-PDF-09ce2a1d
使用 selectpdf
http://selectpdf.com/community-edition/.

1 則留言:

  1. html to pdf onlineHTML to PDF Converter Online | SelectPdf offers a powerful and free to use online html to pdf converter, as well as the possibility to add "download as pdf" buttons on your site.

    回覆刪除