public class ResourceResolver extends Object
Constructor and Description |
---|
ResourceResolver(String baseUri)
Creates ResourceResolver instance.
|
Modifier and Type | Method and Description |
---|---|
void |
resetCache() |
com.itextpdf.kernel.pdf.xobject.PdfImageXObject |
retrieveImage(String src) |
InputStream |
retrieveStyleSheet(String uri) |
public ResourceResolver(String baseUri)
ResourceResolver
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.
The main difference between those two is handling of the relative URIs of resources with slashes in the beginning of them (e.g. "/test/uri", or "//itextpdf.com/example_resources/logo.img"): if base URI is handled as local file system path, then in those cases resources URIs will be simply concatenated to the base path, rather than processed with URI resolution rules (See RFC 3986 "5.4. Reference Resolution Examples"). However absolute resource URIs will be processed correctly.
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.
public com.itextpdf.kernel.pdf.xobject.PdfImageXObject retrieveImage(String src)
public InputStream retrieveStyleSheet(String uri) throws IOException
IOException
public void resetCache()
Copyright © 1998–2019 iText Group NV. All rights reserved.