public class ImageRenderer extends java.lang.Object implements ElementRenderer
| 构造器和说明 |
|---|
ImageRenderer() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
addPicture(org.jsoup.nodes.Element element,
HtmlRenderContext context,
java.io.InputStream inputStream,
int type,
int widthInPixels,
int heightInPixels,
byte[] svgData)
添加图片
|
protected ImageInfo |
analyzeImage(java.io.ByteArrayInputStream inputStream,
boolean svg) |
protected void |
handleData(org.jsoup.nodes.Element element,
HtmlRenderContext context,
java.lang.String src)
处理Data URL
|
protected void |
handleRemoteImage(org.jsoup.nodes.Element element,
HtmlRenderContext context,
java.lang.String src)
处理远程图片
|
boolean |
renderAsBlock() |
boolean |
renderStart(org.jsoup.nodes.Element element,
HtmlRenderContext context)
元素渲染结束需要执行的逻辑
|
java.lang.String[] |
supportedTags() |
protected ImageType |
typeOf(java.awt.image.BufferedImage image)
根据图片反推类型
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrenderEndpublic boolean renderStart(org.jsoup.nodes.Element element,
HtmlRenderContext context)
renderStart 在接口中 ElementRendererelement - HTML元素context - 渲染上下文protected void handleData(org.jsoup.nodes.Element element,
HtmlRenderContext context,
java.lang.String src)
element - HTML元素context - 渲染上下文src - 数据protected ImageType typeOf(java.awt.image.BufferedImage image)
image - 图片protected void handleRemoteImage(org.jsoup.nodes.Element element,
HtmlRenderContext context,
java.lang.String src)
element - HTML元素context - 渲染上下文src - 图片链接地址protected ImageInfo analyzeImage(java.io.ByteArrayInputStream inputStream, boolean svg) throws java.io.IOException, org.apache.poi.openxml4j.exceptions.InvalidFormatException
java.io.IOExceptionorg.apache.poi.openxml4j.exceptions.InvalidFormatExceptionpublic java.lang.String[] supportedTags()
supportedTags 在接口中 ElementRendererpublic boolean renderAsBlock()
renderAsBlock 在接口中 ElementRendererprotected void addPicture(org.jsoup.nodes.Element element,
HtmlRenderContext context,
java.io.InputStream inputStream,
int type,
int widthInPixels,
int heightInPixels,
byte[] svgData)
throws org.apache.poi.openxml4j.exceptions.InvalidFormatException,
java.io.IOException
element - HTML元素context - 渲染上下文inputStream - 图片数据流type - 图片类型widthInPixels - 图片宽度(像素)heightInPixels - 图片高度(像素)svgData - SVG数据org.apache.poi.openxml4j.exceptions.InvalidFormatExceptionjava.io.IOException