public class Html2Image
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.io.File |
convertDebian |
private static java.io.File |
convertMac1 |
private static java.io.File |
convertMac2 |
private static boolean |
usexvfb |
private static java.io.File |
wkhtmltopdfDebian |
private static java.io.File |
wkhtmltopdfMac |
Constructor and Description |
---|
Html2Image() |
Modifier and Type | Method and Description |
---|---|
static boolean |
convertAvailable() |
static void |
main(java.lang.String[] args) |
static boolean |
pdf2image(java.io.File pdf,
java.io.File image,
int width,
int height,
int density,
int quality)
convert a pdf to an image.
|
static boolean |
wkhtmltopdfAvailable() |
static void |
writeSwingImage(java.lang.String url,
java.awt.Dimension size,
java.io.File destination)
render a html page with a JEditorPane, which can do html up to html v 3.2.
|
static boolean |
writeWkhtmltopdf(java.lang.String url,
java.lang.String proxy,
java.lang.String userAgent,
java.lang.String acceptLanguage,
java.io.File destination)
write a pdf of a web page
|
private static boolean |
writeWkhtmltopdfInternal(java.lang.String url,
java.lang.String proxy,
java.io.File destination,
java.lang.String userAgent,
java.lang.String acceptLanguage,
boolean ignoreErrors) |
private static final java.io.File wkhtmltopdfMac
private static final java.io.File convertMac1
private static final java.io.File convertMac2
private static final java.io.File wkhtmltopdfDebian
private static final java.io.File convertDebian
private static boolean usexvfb
public static boolean wkhtmltopdfAvailable()
public static boolean convertAvailable()
public static boolean writeWkhtmltopdf(java.lang.String url, java.lang.String proxy, java.lang.String userAgent, java.lang.String acceptLanguage, java.io.File destination)
url
- proxy
- must be of the form http://host:port; use YaCy here as proxy which is mostly http://localhost:8090destination
- private static boolean writeWkhtmltopdfInternal(java.lang.String url, java.lang.String proxy, java.io.File destination, java.lang.String userAgent, java.lang.String acceptLanguage, boolean ignoreErrors)
public static boolean pdf2image(java.io.File pdf, java.io.File image, int width, int height, int density, int quality)
pdf
- image
- width
- height
- density
- quality
- public static void writeSwingImage(java.lang.String url, java.awt.Dimension size, java.io.File destination) throws java.io.IOException
url
- size
- java.io.IOException
public static void main(java.lang.String[] args)