public class HtmlResourceResolver
extends com.itextpdf.styledxmlparser.resolver.resource.ResourceResolver
ResourceResolver
to also support SVG images
Constructor and Description |
---|
HtmlResourceResolver(String baseUri, ProcessorContext context)
Creates a new HtmlResourceResolver instance.
|
HtmlResourceResolver(String baseUri, ProcessorContext context, com.itextpdf.styledxmlparser.resolver.resource.IResourceRetriever retriever)
Creates a new HtmlResourceResolver instance.
|
Modifier and Type | Method and Description |
---|---|
protected com.itextpdf.kernel.pdf.xobject.PdfXObject |
createImageByUrl(URL url) |
com.itextpdf.kernel.pdf.xobject.PdfXObject |
retrieveImageExtended(String src) |
protected com.itextpdf.kernel.pdf.xobject.PdfXObject |
tryResolveBase64ImageSource(String src)
Retrieve image as either PdfImageXObject , or PdfFormXObject .
|
getRetriever, isDataSrc, isImageTypeSupportedByImageDataFactory, resetCache, resolveAgainstBaseUri, retrieveBytesFromResource, retrieveImage, retrieveResourceAsInputStream, retrieveStream, retrieveStyleSheet, setRetriever, tryResolveUrlImageSource
public HtmlResourceResolver(String baseUri, ProcessorContext context)
HtmlResourceResolver
instance. If baseUri
is a string that represents an absolute URI with any schema except "file" - resources url values will be resolved exactly as "new URL(baseUrl, uriString)". Otherwise base URI will be handled as path in local file system.
If empty string or relative URI string is passed as base URI, then it will be resolved against current working directory of this application instance.
baseUri
- base URI against which all relative resource URIs will be resolved
context
- ProcessorContext
instance for the current HTML to PDF conversion process
public HtmlResourceResolver(String baseUri, ProcessorContext context, com.itextpdf.styledxmlparser.resolver.resource.IResourceRetriever retriever)
HtmlResourceResolver
instance. If baseUri
is a string that represents an absolute URI with any schema except "file" - resources url values will be resolved exactly as "new URL(baseUrl, uriString)". Otherwise base URI will be handled as path in local file system.
If empty string or relative URI string is passed as base URI, then it will be resolved against current working directory of this application instance.
baseUri
- base URI against which all relative resource URIs will be resolved
context
- ProcessorContext
instance for the current HTML to PDF conversion process
retriever
- the resource retriever with the help of which data from resources will be retrieved
public com.itextpdf.kernel.pdf.xobject.PdfXObject retrieveImageExtended(String src)
retrieveImageExtended
in class com.itextpdf.styledxmlparser.resolver.resource.ResourceResolver
protected com.itextpdf.kernel.pdf.xobject.PdfXObject tryResolveBase64ImageSource(String src)
PdfImageXObject
, or PdfFormXObject
.
tryResolveBase64ImageSource
in class com.itextpdf.styledxmlparser.resolver.resource.ResourceResolver
src
- either link to file or base64 encoded stream
Copyright © 1998–2021 iText Group NV. All rights reserved.