Package com.itextpdf.svg.processors.impl
Class SvgConverterProperties
- java.lang.Object
-
- com.itextpdf.svg.processors.impl.SvgConverterProperties
-
- All Implemented Interfaces:
ISvgConverterProperties
public class SvgConverterProperties extends java.lang.Object implements ISvgConverterProperties
Default and fallback implementation ofISvgConverterPropertiesforDefaultSvgProcessor.
-
-
Field Summary
Fields Modifier and Type Field Description private AccessibilityPropertiesaccessibilityPropertiesprivate java.lang.StringbaseUriThe base URI.private java.lang.Stringcharsetprivate CssStyleSheetcssStyleSheetprivate RectanglecustomViewportprivate FontProviderfontProviderThe font provider.private MediaDeviceDescriptionmediaDeviceDescriptionThe media device description.private ISvgNodeRendererFactoryrendererFactoryprivate IResourceRetrieverresourceRetrieverThe resource retriever.
-
Constructor Summary
Constructors Constructor Description SvgConverterProperties()Creates a newSvgConverterPropertiesinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessibilityPropertiesgetAccessibilityProperties()Gets the accessibility properties.java.lang.StringgetBaseUri()Gets the base URI.java.lang.StringgetCharset()Get the name of the Charset to be used when decoding an InputStream.CssStyleSheetgetCssStyleSheet()Gets the CSS style sheet.RectanglegetCustomViewport()Gets the custom viewport of SVG.FontProvidergetFontProvider()Gets the font provider.MediaDeviceDescriptiongetMediaDeviceDescription()Gets the media device description.ISvgNodeRendererFactorygetRendererFactory()Retrieve the factory responsible for creatingISvgNodeRendererIResourceRetrievergetResourceRetriever()Gets the resource retriever.SvgConverterPropertiessetBaseUri(java.lang.String baseUri)Sets the base URI.SvgConverterPropertiessetCharset(java.lang.String charset)Sets the character set.SvgConverterPropertiessetCssStyleSheet(CssStyleSheet cssStyleSheet)Sets the CSS style sheet.voidsetCustomViewport(Rectangle customViewport)Sets the custom viewport of SVG.SvgConverterPropertiessetFontProvider(FontProvider fontProvider)Sets font provider.SvgConverterPropertiessetMediaDeviceDescription(MediaDeviceDescription mediaDeviceDescription)Sets the media device description.SvgConverterPropertiessetRendererFactory(ISvgNodeRendererFactory rendererFactory)Sets renderer factory.SvgConverterPropertiessetResourceRetriever(IResourceRetriever resourceRetriever)Sets the resource retriever.
-
-
-
Field Detail
-
mediaDeviceDescription
private MediaDeviceDescription mediaDeviceDescription
The media device description.
-
fontProvider
private FontProvider fontProvider
The font provider.
-
baseUri
private java.lang.String baseUri
The base URI.
-
resourceRetriever
private IResourceRetriever resourceRetriever
The resource retriever.
-
rendererFactory
private ISvgNodeRendererFactory rendererFactory
-
charset
private java.lang.String charset
-
cssStyleSheet
private CssStyleSheet cssStyleSheet
-
customViewport
private Rectangle customViewport
-
accessibilityProperties
private final AccessibilityProperties accessibilityProperties
-
-
Constructor Detail
-
SvgConverterProperties
public SvgConverterProperties()
Creates a newSvgConverterPropertiesinstance. Instantiates its members, IResourceRetriever and ISvgNodeRendererFactory, to its default implementations.
-
-
Method Detail
-
getCustomViewport
public Rectangle getCustomViewport()
Gets the custom viewport of SVG.The custom viewport is used to resolve percent values of the top level svg.
- Returns:
- the custom viewport
-
getAccessibilityProperties
public AccessibilityProperties getAccessibilityProperties()
Gets the accessibility properties.- Returns:
- the accessibility properties.
-
setCustomViewport
public void setCustomViewport(Rectangle customViewport)
Sets the custom viewport of SVG.The custom viewport is used to resolve percent values of the top level svg.
- Parameters:
customViewport- the custom viewport
-
setRendererFactory
public SvgConverterProperties setRendererFactory(ISvgNodeRendererFactory rendererFactory)
Sets renderer factory.- Parameters:
rendererFactory-ISvgNodeRendererFactoryto set- Returns:
- this
SvgConverterPropertiesinstance
-
setFontProvider
public SvgConverterProperties setFontProvider(FontProvider fontProvider)
Sets font provider.- Parameters:
fontProvider-FontProviderto set- Returns:
- this
SvgConverterPropertiesinstance
-
getRendererFactory
public ISvgNodeRendererFactory getRendererFactory()
Description copied from interface:ISvgConverterPropertiesRetrieve the factory responsible for creatingISvgNodeRenderer- Specified by:
getRendererFactoryin interfaceISvgConverterProperties- Returns:
- A
ISvgNodeRendererFactoryimplementation
-
getCharset
public java.lang.String getCharset()
Description copied from interface:ISvgConverterPropertiesGet the name of the Charset to be used when decoding an InputStream. This method is allowed to return null, in which caseUTF-8will be used (by JSoup).Please be aware that this method is NOT used when handling a
Stringvariable in theSvgConverter.- Specified by:
getCharsetin interfaceISvgConverterProperties- Returns:
- the String name of the
Charsetused for decoding
-
setCharset
public SvgConverterProperties setCharset(java.lang.String charset)
Sets the character set.- Parameters:
charset- the character set to set- Returns:
- this
SvgConverterPropertiesinstance
-
getBaseUri
public java.lang.String getBaseUri()
Gets the base URI.- Specified by:
getBaseUriin interfaceISvgConverterProperties- Returns:
- the base URI
-
getFontProvider
public FontProvider getFontProvider()
Gets the font provider.- Specified by:
getFontProviderin interfaceISvgConverterProperties- Returns:
- the font provider
-
getMediaDeviceDescription
public MediaDeviceDescription getMediaDeviceDescription()
Gets the media device description.- Specified by:
getMediaDeviceDescriptionin interfaceISvgConverterProperties- Returns:
- the media device description
-
setMediaDeviceDescription
public SvgConverterProperties setMediaDeviceDescription(MediaDeviceDescription mediaDeviceDescription)
Sets the media device description.- Parameters:
mediaDeviceDescription- the media device description- Returns:
- the ConverterProperties instance
-
setBaseUri
public SvgConverterProperties setBaseUri(java.lang.String baseUri)
Sets the base URI.- Parameters:
baseUri- the base URI- Returns:
- the ConverterProperties instance
-
getResourceRetriever
public IResourceRetriever getResourceRetriever()
Description copied from interface:ISvgConverterPropertiesGets the resource retriever. The resourceRetriever is used to retrieve data from resources by URL.- Specified by:
getResourceRetrieverin interfaceISvgConverterProperties- Returns:
- the resource retriever
-
setResourceRetriever
public SvgConverterProperties setResourceRetriever(IResourceRetriever resourceRetriever)
Sets the resource retriever. The resourceRetriever is used to retrieve data from resources by URL.- Parameters:
resourceRetriever- the resource retriever- Returns:
- the
SvgConverterPropertiesinstance
-
getCssStyleSheet
public CssStyleSheet getCssStyleSheet()
Description copied from interface:ISvgConverterPropertiesGets the CSS style sheet. Style sheet is used to apply CSS statements to elements.- Specified by:
getCssStyleSheetin interfaceISvgConverterProperties- Returns:
- the CSS style sheet
-
setCssStyleSheet
public SvgConverterProperties setCssStyleSheet(CssStyleSheet cssStyleSheet)
Sets the CSS style sheet. Style sheet is used to apply CSS statements to elements.- Parameters:
cssStyleSheet- the CSS style sheet- Returns:
- the
SvgConverterPropertiesinstance
-
-