Class HtmlHeadConfiguration
- All Implemented Interfaces:
Serializable
Trust boundary: every property here is integrator-supplied
configuration, not attacker-reachable RTF content — no data parsed from the
RTF input stream can reach this class or influence its values. As a defence
in depth (since 11.5), characters XML does not allow are removed, a style
sheet link must be a relative URL or use http or https, and
the embedded style sheet cannot end its <style> element. This does
not make untrusted values safe: a style sheet still controls the page's
look. Do not populate these properties from untrusted input (e.g. a
document title taken from the RTF file name, or the RTF file's own
\info/\title metadata, which this converter does not even
parse). See docs/SECURITY.md, section "What this does not protect
against".
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHtmlHeadConfiguration(String defaultGenerator) Represents a configuration for the HTML head section. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStyleSheetLink(String href) Adds a style sheet link to the list of style sheet links in the HTML head configuration.booleanvoidsetDocumentTitle(String newValue) Sets the document title.voidsetIncludeDefaultFontStyle(boolean newValue) If this property is set to true, the HTML head section will include a CSS definition for the default font style.voidsetMetaAuthor(String newValue) This property may be used to specify a META tag which contains the document author.voidsetMetaDescription(String newValue) This property may be used to specify a document description.voidsetMetaGenerator(String newValue) This property may be used to specify the content of the generator "meta" element.voidsetMetaKeywords(String newValue) This property may be used to specify keywords for the document.voidsetMetaViewport(String newValue) Use this property to define the viewport meta-tag manually.voidsetStyleSheetInclude(String newValue) Additional style sheet definitions which are stored in the HTML document.voidsetStyleSheetLink(String newValue) URL of a file which contains external CSS style sheet definitions for the HTML document.voidsetStyleSheetLinks(List<String> newValue)
-
Constructor Details
-
HtmlHeadConfiguration
Represents a configuration for the HTML head section.- Parameters:
defaultGenerator- the default value for the "generator" meta-tag.
-
-
Method Details
-
setDocumentTitle
Sets the document title.Note: this property is only effective if the property
AddOuterHTMLis set to true.- Parameters:
newValue- The new documentTitle value- Default value:
- "Untitled document"
-
setIncludeDefaultFontStyle
public void setIncludeDefaultFontStyle(boolean newValue) If this property is set to true, the HTML head section will include a CSS definition for the default font style.Note: this property is only effective if the property
AddOuterHTMLis set to true.- Parameters:
newValue- The new includeDefaultFontStyle value- See Also:
- Default value:
- false
-
setMetaAuthor
This property may be used to specify a META tag which contains the document author.Note: this property is only effective if the property
AddOuterHTMLis set to true.- Parameters:
newValue- The new metaAuthor value- Default value:
- empty
-
setMetaDescription
This property may be used to specify a document description.Note: this property is only effective if the property
AddOuterHTMLis set to true.- Parameters:
newValue- The new metaDescription value- Default value:
- empty
-
setMetaGenerator
This property may be used to specify the content of the generator "meta" element.- Parameters:
newValue- The new metaGenerator value- Default value:
- name and version of the converter
-
setMetaKeywords
This property may be used to specify keywords for the document.Note: this property is only effective if the property
AddOuterHTMLis set to true.- Parameters:
newValue- The new metaKeywords value- Default value:
- empty
-
setMetaViewport
Use this property to define the viewport meta-tag manually.Note: this property is only effective if the property
AddOuterHTMLis set to true.- Parameters:
newValue- The new viewport value- Default value:
- empty
-
setStyleSheetInclude
Additional style sheet definitions which are stored in the HTML document.Note: this property is only effective if the property
AddOuterHTMLis set to true.- Parameters:
newValue- The new styleSheetInclude value- Default value:
- empty
-
setStyleSheetLink
URL of a file which contains external CSS style sheet definitions for the HTML document.Note: this property is only effective if the property
AddOuterHTMLis set to true.Only a relative URL or one with the scheme
httporhttpsis written; any other link (for examplejavascript:,data:,//host/..., or one with spaces) is dropped with a warning. The same applies toaddStyleSheetLink(java.lang.String)andsetStyleSheetLinks(java.util.List<java.lang.String>).- Parameters:
newValue- The new styleSheetLink value- Default value:
- empty
-
addStyleSheetLink
Adds a style sheet link to the list of style sheet links in the HTML head configuration.- Parameters:
href- The URL of the style sheet file
-
setStyleSheetLinks
-
getDocumentTitle
-
isIncludeDefaultFontStyle
public boolean isIncludeDefaultFontStyle() -
getMetaAuthor
-
getMetaDescription
-
getMetaGenerator
-
getMetaKeywords
-
getMetaViewport
-
getStyleSheetInclude
-
getStyleSheetLinks
-