public class Html2Pdf extends Object
| Constructor and Description |
|---|
Html2Pdf() |
| Modifier and Type | Method and Description |
|---|---|
static void |
convert(File htmlFile,
File targetPdfFile)
convert HTML file to PDF file use default converter properties.
|
static void |
convert(File htmlFile,
File targetPdfFile,
com.itextpdf.html2pdf.ConverterProperties properties) |
static void |
convert(File htmlFile,
File targetPdfFile,
String baseUri) |
static void |
convert(String htmlContent,
File targetPdfFile) |
static void |
convert(String htmlContent,
File targetPdfFile,
com.itextpdf.html2pdf.ConverterProperties properties) |
static void |
convert(String htmlContent,
File targetPdfFile,
String baseUri) |
static com.itextpdf.layout.font.FontProvider |
getDefaultCJKFontProvider()
get default CJK font provider which use
1.
|
static com.itextpdf.html2pdf.ConverterProperties |
getDefaultConverterProperties()
get default converter properties
which provides CJK font support and use "UTF-8" as encoding
|
static void |
main(String[] args) |
public static com.itextpdf.html2pdf.ConverterProperties getDefaultConverterProperties()
public static com.itextpdf.layout.font.FontProvider getDefaultCJKFontProvider()
public static void convert(File htmlFile, File targetPdfFile) throws IOException
Remember the converter will use the parent folder of HTML file as base-URI(resource context)
htmlFile - targetPdfFile - IOExceptionpublic static void convert(File htmlFile, File targetPdfFile, String baseUri) throws IOException
IOExceptionpublic static void convert(File htmlFile, File targetPdfFile, com.itextpdf.html2pdf.ConverterProperties properties) throws IOException
IOExceptionpublic static void convert(String htmlContent, File targetPdfFile) throws IOException
IOExceptionpublic static void convert(String htmlContent, File targetPdfFile, String baseUri) throws IOException
IOExceptionpublic static void convert(String htmlContent, File targetPdfFile, com.itextpdf.html2pdf.ConverterProperties properties) throws IOException
IOExceptionpublic static void main(String[] args) throws IOException
IOExceptionCopyright © 2020. All rights reserved.