Skip to content

RyougiChan/HTML2PDF-netcore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTML2PDF-netcore

Generating editable PDF files from HTML code with CSS properties support

Dependency

  • itext7
    • Version: 7.1.4
    • Author: iText Software
    • license: AGPL
  • itext7.pdfhtml
    • Version: 2.1.1
    • Author: iText Software
    • license: Legal

Getting Start

pm> Install-Package itext7 -Version 7.1.4
pm> Install-Package itext7.pdfhtml -Version 2.1.1
  • Run App
~$ dotnet HTML2PDF-netcore.dll
  • API
    • Create

      http://localhost:5000/api/pdf/create?pdfHtmlString=<div%20class="main"%20style="margin:%2030px%200;">DHCPスヌーピングをサポートし、DHCPサーバを設定し、DHCPサーバの適合性を保証します。</div>&saveName=test

    • CreateFromHtml

      Create PDF files using HTML file in path /wwwroot/src/html/. If parameter htmlFileName is given, it create PDF file using this specific HTML file, otherwise using all HTML files in the path(create multiple PDF files).

      http://localhost:5000/api/pdf/createfromhtml?htmlFileName=forTest.html

      • The generated PDF files will be located in the same path /wwwroot/src/html/.
    • TestCreate

      The test method for API Create. You will get a pdf created using the existed HTML string(parameter pdfHtmlString in Create) as follows by calling this.

      <div class="main" style="margin: 30px 0;">
        DHCPスヌーピングをサポートし、DHCPサーバを設定し、DHCPサーバの適合性を保証します。DoS防御をサポートし、防御ランドスキャン、SYNFIN、Xmascan、Ping Floodingなどを攻撃。
      </div>
      • uri: http://localhost:5000/api/pdf/testcreate
      • method: GET
      • If you are using a machine with Unix system, the generated PDF file can be found at path /data/webroot/pdf/.
      • If you are using a machine with Windows system, the generated PDF file may be found at path D:\pdf(If disk D exist).

Declaration

  • This project is license by GNU GENERAL PUBLIC LICENSE.
  • The ownership of this project is owned by the author. All resources in this project are based on CC BY-NC-SA 4.0 , that means you can copy and reissue the contents of this project, but you will also have to provide the original author information as well as the agreement statement. At the same time, it cannot be used for commercial purposes. In accordance with our narrow understanding (Additional subsidiary terms), All activities that are profitable are of commercial use.

About

Generating editable PDF files from HTML code with CSS properties support | HTML 转 PDF 的 .NetCore 方案

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published