Skip to content

Latest commit

 

History

History

ts-pdf

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Java export PDF

Add denpendency

<dependency>
      <groupId>com.cc.pub</groupId>
      <artifactId>ts-pdf</artifactId>
      <version>0.0.1-SNAPSHOT</version>
</dependency>

Usage

public static void main(String[] args) {
        String filePath = "/Users/carlosxiao/Downloads/file.pdf";
        String content = "<!DOCTYPE html><html><meta charset='utf-8'/><head></head><body style='margin:0; padding:0px; color:#666; font-family:SimSun; font-size:14px;'><h1>hello</h1></body></html>";
        PdfExportUtil.exportToFile(filePath, content);