Class: QgsHtmlRenderSettings

Encapsulates settings for rendering HTML content.

Added in version 4.4.

List of all members, including inherited members

Methods

asMap

Returns the settings encapsulated in a variantmap, for passing to the qgis_html_to_pdf utility.

baseUrl

Returns the base URL used when resolving relative links.

featureJson

Returns the feature json (as a variant map).

isEmpty

Returns True no settings are set.

setBaseUrl

Sets the base url to use when resolving relative links.

setFeatureJson

Sets the feature json (as a variant map).

setUserStylesheet

Sets the user stylesheet CSS rules to use while rendering the HTML content.

userStylesheet

Returns the user stylesheet CSS rules used while rendering the HTML content.

class qgis.core.QgsHtmlRenderSettings[source]

Bases: object

asMap(self) → dict[str, Any][source]

Returns the settings encapsulated in a variantmap, for passing to the qgis_html_to_pdf utility.

Return type:

dict[str, Any]

baseUrl(self) → QUrl[source]

Returns the base URL used when resolving relative links.

See also

setBaseUrl()

Return type:

QUrl

featureJson(self) → dict[str, Any][source]

Returns the feature json (as a variant map).

When the HTML has been loaded, an attempt will be made to call a “setFeature” function, passing this custom json object.

See also

setFeatureJson()

Return type:

dict[str, Any]

isEmpty(self) → bool[source]

Returns True no settings are set.

Return type:

bool

setBaseUrl(self, url: QUrl)[source]

Sets the base url to use when resolving relative links.

See also

baseUrl()

Parameters:

url (QUrl)

setFeatureJson(self, json: dict[str | None, Any])[source]

Sets the feature json (as a variant map).

When the HTML has been loaded, an attempt will be made to call a “setFeature” function, passing this custom json object.

See also

featureJson()

Parameters:

json (dict[str|None, Any])

setUserStylesheet(self, stylesheet: str | None)[source]

Sets the user stylesheet CSS rules to use while rendering the HTML content.

These allow for overriding the styles specified within the HTML source.

See also

userStylesheet()

Parameters:

stylesheet (str|None)

userStylesheet(self) → str[source]

Returns the user stylesheet CSS rules used while rendering the HTML content.

These overriding the styles specified within the HTML source.

Return type:

str