Package com.winnovative_software
Class HtmlToSvgConverter
java.lang.Object
com.winnovative_software.HtmlToSvgConverter
This class offers the necessary methods to create a SVG document from a web
page at given URL or from a HTML String. The generated SVG document can be
saved into a memory buffer or into a file
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a HTML to SVG converter which will connect to localhost on the default portHtmlToSvgConverter
(boolean useWebService, String webServiceUrl) Constructs a HTML to SVG converter which will connect to a web service URLHtmlToSvgConverter
(int port) Constructs a HTML to SVG converter which will connect to localhost on the specified portHtmlToSvgConverter
(String server) Constructs a HTML to SVG converter which will connect to the server specified by IP or by name on the default portHtmlToSvgConverter
(String server, int port) Constructs a HTML to SVG converter which will connect to the server specified by IP or by name on the specified port -
Method Summary
Modifier and TypeMethodDescriptionThis property can be set with an username and a password in order to authenticate to the web server before accessing the URL to be converted They can be used for example to resolve the IIS Integrated Windows Authentication or other types of IIS authenticationGets the java.net.Proxy object to be used when accessing the HTML to SVG Web Service through a proxy server.boolean
Gets a flag indicating if the HTML content is clipped by HTML viewer window widthint
Gets the additional time in seconds to wait for asynchronous items to be completely loaded or for a web page redirect to finish before starting the rendering in converter.byte[]
convertHtml
(String html, String baseUrl) Converts a HTML String into a SVG document using a base URL to resolve the external resources and returns the rendered SVG document into a memory buffervoid
convertHtmlToFile
(String html, String baseUrl, String outFile) Converts the specified HTML String into a SVG document using a base URL to resolve the external resources and saves the rendered SVG document to the specified filebyte[]
convertUrl
(String url) Converts an URL to a SVG document and returns the rendered SVG document into a memory buffervoid
convertUrlToFile
(String url, String outFile) Converts the specified URL into a SVG document and saves the rendered SVG document to the specified fileGets the default HTML document text encoding to be used if there is no charset meta tag defined in the HTML documentboolean
Gets the flag indicating if the converter should try to download all the resourcesboolean
Gets the flag indicating if the accelerated CSS 3D transformations are enabled in converter.boolean
Gets the flag indicating if the accelerated 2D canvas is enabled in converterboolean
Gets the flag indicating if the HTTP2 protocol is enabled in in HTML to SVG converter.boolean
Gets the flag indicating if the persistent local storage is enabled in converterboolean
Gets the flag indicating if the WebGL is enabled in converterboolean
Gets the flag indicating if the HTML viewer extensions are executed during conversion.int
Gets the HTML viewer height in pixels in the HTML to SVG converterint
Gets the preferred HTML viewer width in pixels in HTML to SVG converterint
Gets the HTML viewer zoom percentage in HTML to SVG Converter similar to zoom level in a browserReturns the collection of HTTP POST fields to be used when accessing a web page in converter.Gets a collection of custom HTTP cookies to be sent by converter to the web server when the web page to convert and the resources (image, css, etc) referenced by the web page are requested.Gets a collection of custom HTTP headers to be sent by converter to the web server when the web page is requested from a URL.The impersonation options applied during navigationint
Gets the initial height in pixels of the HTML viewer in converterboolean
Gets the flag indicating if the slow JavaScript script should be interrupted in converter.boolean
Gets the flag indicating if JavaScript execution is enabled in converterGets the license key stringboolean
Gets the a flag indicating if the access to local files is enabled in the HTML to SVG converterint
Gets the additional time in seconds to wait after manual triggering before starting the rendering.int
Gets the maximum height in pixels to be rendered from the HTML document by converterGets the media type of the HTML document used by converter.int
Gets the minimum height in pixels to be rendered from the HTML document by converterint
Gets the navigation timeout in secondsGets the custom user agent to be used when accessing the HTML pageint
Gets the resolution of the SVG documentboolean
Gets flag indicating if the calculated size of the SVG document should be set in the generated documentboolean
Gets the flag indicating if the converter will send the custom headers defined by thehttpRequestHeaders()
property each time an external resource (image, css, etc) referenced by the web page is requestedint
port()
Gets the HTML to SVG server port numberboolean
Gets the flag indicating if the converter should perform a pre-renderingGets a reference to an object encapsulating the proxy options used by converter to access the HTML document to convertGets the CSS selector of the HTML element to be rendered to PDF by converterserver()
Gets the HTML to SVG server IP or nameGets the HTML to SVG converter service passwordvoid
setClientProxy
(Proxy clientProxy) Sets the java.net.Proxy object to be used when accessing the HTML to SVG Web Service through a proxy server.void
setClipHtmlView
(boolean clipView) Sets a flag indicating if the HTML content is clipped by HTML viewer window width.void
setConversionDelay
(int delay) Sets an additional time in seconds to wait for asynchronous items to be completely loaded or for a web page redirect to finish before starting the rendering in converter.void
setDefaultHtmlEncoding
(String encoding) Sets the default HTML document text encoding to be used if there is no charset meta tag defined in the HTML documentvoid
setDownloadAllResources
(boolean download) Sets the flag indicating if the converter should try to download all the resources even if this could cause a slower conversion.void
setEnable3DTransformations
(boolean enabled) Gets or sets a flag indicating if the accelerated CSS 3D transformations are enabled in converter.void
setEnableAccelerated2DCanvas
(boolean enabled) Sets the flag indicating if the accelerated 2D canvas is enabled in converter.void
setEnableHttp2
(boolean enabled) Sets the flag indicating if the the HTTP2 protocol is enabled in in HTML to SVG converter.void
setEnablePersistentStorage
(boolean enabled) Sets the flag indicating if the persistent local storage is enabled in converter.void
setEnableWebGL
(boolean enabled) Sets a flag indicating if the WebGL is enabled in converter.void
setExtensionsEnabled
(boolean enabled) Sets a flag indicating if the HTML viewer extensions are executed during conversion.void
setHtmlViewerHeight
(int viewerHeight) Sets the HTML viewer height in pixels in the HTML to SVG converter.void
setHtmlViewerWidth
(int viewerWidth) Gets or sets the preferred HTML viewer width in pixels in HTML to SVG converter.void
setHtmlViewerZoom
(int viewerZoom) Sets HTML viewer zoom percentage in HTML to SVG Converter similar to zoom level in a browser.void
setInitialHtmlViewerHeight
(int initialHeight) Sets the initial height in pixels of the HTML viewer in converter.void
setInterruptSlowJavaScript
(boolean interrupt) Sets a flag indicating if the slow JavaScript script should be interrupted in converter.void
setJavaScriptEnabled
(boolean enabled) Sets a flag indicating if JavaScript execution is enabled in converter.void
setLicenseKey
(String key) Sets the license key string received from the vendor in HTML to SVG converter.void
setLocalFilesAccessEnabled
(boolean enabled) Sets the flag indicating if the access to local files is enabled in the HTML to SVG converter.void
setManualTriggeringConversionDelay
(int delay) Sets an additional time in seconds to wait after manual triggering before starting the rendering.void
setMaxHtmlViewerHeight
(int maxHeight) Sets the maximum height in pixels to be rendered from the HTML document by converter.void
setMediaType
(String media) Sets the media type of the HTML document used by converter.void
setMinHtmlViewerHeight
(int minHeight) Sets the minimum height in pixels to be rendered from the HTML document by converter.void
setNavigationTimeout
(int timeout) Sets the converter navigation timeout in seconds.void
setNavigatorUserAgent
(String navigatorUserAgent) Sets the custom user agent to be used when accessing the HTML page.void
setOutputResolution
(int dpi) Sets resolution of the SVG documentvoid
setOutputSize
(boolean setSize) Sets flag indicating if the calculated size of the SVG document should be set in the generated documentvoid
setPersistentHttpRequestHeaders
(boolean persistentHttpRequestHeaders) Sets the flag indicating if the converter will send the custom headers defined by thehttpRequestHeaders()
property each time an external resource (image, css, etc) referenced by the web page is requested.void
setPort
(int port) Sets the HTML to SVG server port numbervoid
setPrerenderEnabled
(boolean enabled) Sets a flag indicating if the converter should perform a pre-rendering.void
setRenderedHtmlElementSelector
(String selector) Gets or sets the CSS selector of the HTML element to be rendered to PDF by converter.void
Sets the HTML to SVG server IP or namevoid
setServicePassword
(String password) Sets the HTML to SVG converter service password.void
setSvgFontsEnabled
(boolean enabled) Sets a flag indicating if the SVG fonts are enabled in HTML during conversion.void
Sets the conversion triggering mode used by convertervoid
setUseWebService
(boolean useWebService) Sets the flag indicating if the client library will call the Web service or the TCP service to perform the HTML to SVG conversionvoid
setWebFontsEnabled
(boolean enabled) Sets the flag indicating if the Web Fonts are enabled in HTML during conversion.void
setWebServiceUrl
(String webServiceUrl) Sets the HTML to SVG web service URLboolean
Gets the flag indicating if the SVG fonts are enabled in HTML during conversion.Gets the conversion triggering mode used by converterboolean
Gets the flag indicating if the client library will call the Web service or the TCP service to perform the HTML to SVG conversionboolean
Gets the flag indicating if the Web Fonts are enabled in HTML during conversion.Gets the HTML to SVG web service URL
-
Constructor Details
-
HtmlToSvgConverter
public HtmlToSvgConverter()Constructs a HTML to SVG converter which will connect to localhost on the default port -
HtmlToSvgConverter
Constructs a HTML to SVG converter which will connect to the server specified by IP or by name on the default port- Parameters:
server
- The IP address or host name of the HTML to PDF server
-
HtmlToSvgConverter
public HtmlToSvgConverter(int port) Constructs a HTML to SVG converter which will connect to localhost on the specified port- Parameters:
port
- The HTML to PDF server port number on localhost
-
HtmlToSvgConverter
Constructs a HTML to SVG converter which will connect to the server specified by IP or by name on the specified port- Parameters:
server
- The IP address or host name of the HTML to PDF serverport
- The HTML to PDF server port number on host
-
HtmlToSvgConverter
Constructs a HTML to SVG converter which will connect to a web service URL- Parameters:
useWebService
- a flag indicating if the converter will use the web service URL or the TCP serverwebServiceUrl
- The web service URL when the useWebService parameter is true or the TCP server host name or IP address when the useWebService parameter is false
-
-
Method Details
-
server
Gets the HTML to SVG server IP or name- Returns:
- the server IP or name
-
setServer
Sets the HTML to SVG server IP or name- Parameters:
server
- the server IP or name
-
port
public int port()Gets the HTML to SVG server port number- Returns:
- the server port number
-
setPort
public void setPort(int port) Sets the HTML to SVG server port number- Parameters:
port
- the server port number
-
webServiceUrl
Gets the HTML to SVG web service URL- Returns:
- the web service URL
-
setWebServiceUrl
Sets the HTML to SVG web service URL- Parameters:
webServiceUrl
- the web service URL
-
useWebService
public boolean useWebService()Gets the flag indicating if the client library will call the Web service or the TCP service to perform the HTML to SVG conversion- Returns:
- the use web service option
-
setUseWebService
public void setUseWebService(boolean useWebService) Sets the flag indicating if the client library will call the Web service or the TCP service to perform the HTML to SVG conversion- Parameters:
useWebService
- the use web service option
-
clientProxy
Gets the java.net.Proxy object to be used when accessing the HTML to SVG Web Service through a proxy server.- Returns:
- java.net.Proxy object to be used to establish connection with the server
-
setClientProxy
Sets the java.net.Proxy object to be used when accessing the HTML to SVG Web Service through a proxy server. This property does not have any effect when using a TCP Service- Parameters:
clientProxy
- the java.net.Proxy object to be used to establish connection with the server
-
outputResolution
public int outputResolution()Gets the resolution of the SVG document- Returns:
- resolution of the SVG document
-
setOutputResolution
public void setOutputResolution(int dpi) Sets resolution of the SVG document- Parameters:
dpi
- resolution of the SVG document
-
outputSize
public boolean outputSize()Gets flag indicating if the calculated size of the SVG document should be set in the generated document- Returns:
- the flag value
-
setOutputSize
public void setOutputSize(boolean setSize) Sets flag indicating if the calculated size of the SVG document should be set in the generated document- Parameters:
setSize
- the flag value to set
-
htmlViewerWidth
public int htmlViewerWidth()Gets the preferred HTML viewer width in pixels in HTML to SVG converter- Returns:
- the preferred HTML viewer width in pixels
-
setHtmlViewerWidth
public void setHtmlViewerWidth(int viewerWidth) Gets or sets the preferred HTML viewer width in pixels in HTML to SVG converter. If the HTML content is not entirely visible in the HTML viewer at the specified width, theclipHtmlView()
property will control whether the HTML content is clipped or the HTML viewer width is automatically extended to make visible the whole HTML content. By default theclipHtmlView()
property is false and the HTML viewer is automatically extended in width to make visible the whole HTML content. The HTML viewer width can also be specified in the HtmlToSvgConverter class constructor. The default value is 1024 pixels- Parameters:
viewerWidth
- the HTML viewer width to set
-
htmlViewerHeight
public int htmlViewerHeight()Gets the HTML viewer height in pixels in the HTML to SVG converter- Returns:
- the HTML viewer height
-
setHtmlViewerHeight
public void setHtmlViewerHeight(int viewerHeight) Sets the HTML viewer height in pixels in the HTML to SVG converter. If the specified HTML viewer height is 0 the HTML viewer height will be automatically determined based on the HTML content and the HTML viewer width in order to make visible the whole HTML content. The HTML viewer width is given by thehtmlViewerWidth()
property of theHtmlToSvgConverter
class. If the HTML content is not entirely visible in the HTML viewer at the specified width, theclipHtmlView()
property will control whether the HTML content is clipped or the HTML viewer width is automatically extended to make visible the whole HTML content. The HTML viewer height can also be specified in theHtmlToSvgConverter
class constructor. The default value is 0 to automatically determine the HTML viewer height based on the HTML content and the HTML viewer width- Parameters:
viewerHeight
- the HTML viewer height to set
-
htmlViewerZoom
public int htmlViewerZoom()Gets the HTML viewer zoom percentage in HTML to SVG Converter similar to zoom level in a browser- Returns:
- the HTML viewer zoom
-
setHtmlViewerZoom
public void setHtmlViewerZoom(int viewerZoom) Sets HTML viewer zoom percentage in HTML to SVG Converter similar to zoom level in a browser. The default value of this property is 100- Parameters:
viewerZoom
- the HTML viewer zoom to set
-
clipHtmlView
public boolean clipHtmlView()Gets a flag indicating if the HTML content is clipped by HTML viewer window width- Returns:
- the HTML content clipping option
-
setClipHtmlView
public void setClipHtmlView(boolean clipView) Sets a flag indicating if the HTML content is clipped by HTML viewer window width. If the HTML content is not entirely visible in the HTML viewer at the specified width, this property will control whether the HTML content is clipped or the HTML viewer width is automatically extended to make visible the whole HTML content. The HTML viewer width is given by thehtmlViewerWidth()
property. The default value of this property is false- Parameters:
clipView
- the HTML clipping option value
-
licenseKey
Gets the license key string- Returns:
- the license key string
-
setLicenseKey
Sets the license key string received from the vendor in HTML to SVG converter. If this property is null the converter will automatically enter in evaluation mode and a demo watermark will be displayed on the generated PDF document- Parameters:
key
- the license key string to set
-
servicePassword
Gets the HTML to SVG converter service password- Returns:
- the service password
-
setServicePassword
Sets the HTML to SVG converter service password. You have to set this property if the HTML to SVG service is password protected- Parameters:
password
- the service password to set
-
javaScriptEnabled
public boolean javaScriptEnabled()Gets the flag indicating if JavaScript execution is enabled in converter- Returns:
- the flag indicating if JavaScript execution is enabled in converter
-
setJavaScriptEnabled
public void setJavaScriptEnabled(boolean enabled) Sets a flag indicating if JavaScript execution is enabled in converter. The default is true- Parameters:
enabled
- the flag value to set
-
enable3DTransformations
public boolean enable3DTransformations()Gets the flag indicating if the accelerated CSS 3D transformations are enabled in converter. The default value is false- Returns:
- the flag indicating if the accelerated CSS 3D transformations are enabled in converter
-
setEnable3DTransformations
public void setEnable3DTransformations(boolean enabled) Gets or sets a flag indicating if the accelerated CSS 3D transformations are enabled in converter. The default value is false- Parameters:
enabled
- the flag value to set
-
enableWebGL
public boolean enableWebGL()Gets the flag indicating if the WebGL is enabled in converter- Returns:
- the flag indicating if the WebGL is enabled in converter
-
setEnableWebGL
public void setEnableWebGL(boolean enabled) Sets a flag indicating if the WebGL is enabled in converter. The default value is false- Parameters:
enabled
- the flag value to set
-
enableAccelerated2DCanvas
public boolean enableAccelerated2DCanvas()Gets the flag indicating if the accelerated 2D canvas is enabled in converter- Returns:
- the flag indicating if the accelerated 2D canvas is enabled in converter
-
setEnableAccelerated2DCanvas
public void setEnableAccelerated2DCanvas(boolean enabled) Sets the flag indicating if the accelerated 2D canvas is enabled in converter. The default value is false- Parameters:
enabled
- the flag value to set
-
enablePersistentStorage
public boolean enablePersistentStorage()Gets the flag indicating if the persistent local storage is enabled in converter- Returns:
- the flag indicating if the persistent local storage is enabled in converter
-
setEnablePersistentStorage
public void setEnablePersistentStorage(boolean enabled) Sets the flag indicating if the persistent local storage is enabled in converter. The default value is false- Parameters:
enabled
- the flag value to set
-
localFilesAccessEnabled
public boolean localFilesAccessEnabled()Gets the a flag indicating if the access to local files is enabled in the HTML to SVG converter- Returns:
- flag indicating if the access to local files is enabled in the HTML to SVG converter
-
setLocalFilesAccessEnabled
public void setLocalFilesAccessEnabled(boolean enabled) Sets the flag indicating if the access to local files is enabled in the HTML to SVG converter. The default value is true- Parameters:
enabled
- the flag value to set
-
authenticationOptions
This property can be set with an username and a password in order to authenticate to the web server before accessing the URL to be converted They can be used for example to resolve the IIS Integrated Windows Authentication or other types of IIS authentication- Returns:
- the object encapsulating the authentication options
-
impersonationOptions
The impersonation options applied during navigation- Returns:
- the object encapsulating the impersonation options
-
proxyOptions
Gets a reference to an object encapsulating the proxy options used by converter to access the HTML document to convert- Returns:
- a reference to an object encapsulating the proxy options used by converter to access the HTML document to convert
-
httpPostFields
Returns the collection of HTTP POST fields to be used when accessing a web page in converter. If there are elements in collection then the converter will make a POST request to the web page URL with the fields from this collection, otherwise it will make a GET request- Returns:
- the collection of HTTP POST fields to be used when accessing a web page in converter
-
mediaType
Gets the media type of the HTML document used by converter.- Returns:
- the media type used by converter
-
setMediaType
Sets the media type of the HTML document used by converter. The default media type is 'screen'. If you set this property with 'print' then the CSS properties defined in '@media print' rule will be used to render the document- Parameters:
media
- the media type to be used by converter
-
svgFontsEnabled
public boolean svgFontsEnabled()Gets the flag indicating if the SVG fonts are enabled in HTML during conversion.- Returns:
- the flag indicating if the SVG fonts are enabled
-
setSvgFontsEnabled
public void setSvgFontsEnabled(boolean enabled) Sets a flag indicating if the SVG fonts are enabled in HTML during conversion. The default value is false- Parameters:
enabled
- the flag value to set
-
webFontsEnabled
public boolean webFontsEnabled()Gets the flag indicating if the Web Fonts are enabled in HTML during conversion.- Returns:
- the flag indicating if the Web Fonts are enabled
-
setWebFontsEnabled
public void setWebFontsEnabled(boolean enabled) Sets the flag indicating if the Web Fonts are enabled in HTML during conversion.- Parameters:
enabled
- the flag value to set
-
enableHttp2
public boolean enableHttp2()Gets the flag indicating if the HTTP2 protocol is enabled in in HTML to SVG converter. The property has effect only with NE version of the server- Returns:
- the flag indicating if the HTTP2 protocol is enabled
-
setEnableHttp2
public void setEnableHttp2(boolean enabled) Sets the flag indicating if the the HTTP2 protocol is enabled in in HTML to SVG converter. The property has effect only with NE version of the server. The default value is false- Parameters:
enabled
- the flag value to set
-
extensionsEnabled
public boolean extensionsEnabled()Gets the flag indicating if the HTML viewer extensions are executed during conversion.- Returns:
- the flag indicating if the HTML viewer extensions are executed
-
setExtensionsEnabled
public void setExtensionsEnabled(boolean enabled) Sets a flag indicating if the HTML viewer extensions are executed during conversion. The default value is false and no extension is executed. The Flash player for Mozilla Firefox must be installed in order to execute the flash content from HTML- Parameters:
enabled
- the flag value to set
-
downloadAllResources
public boolean downloadAllResources()Gets the flag indicating if the converter should try to download all the resources- Returns:
- the flag indicating if the converter should try to download all the resources
-
setDownloadAllResources
public void setDownloadAllResources(boolean download) Sets the flag indicating if the converter should try to download all the resources even if this could cause a slower conversion. The default value is false- Parameters:
download
- the flag value to set
-
prerenderEnabled
public boolean prerenderEnabled()Gets the flag indicating if the converter should perform a pre-rendering- Returns:
- the flag indicating if the converter should perform a pre-rendering
-
setPrerenderEnabled
public void setPrerenderEnabled(boolean enabled) Sets a flag indicating if the converter should perform a pre-rendering. The default value is false- Parameters:
enabled
- the flag value to set
-
interruptSlowJavaScript
public boolean interruptSlowJavaScript()Gets the flag indicating if the slow JavaScript script should be interrupted in converter.- Returns:
- the flag indicating if the slow JavaScript script should be interrupted
-
setInterruptSlowJavaScript
public void setInterruptSlowJavaScript(boolean interrupt) Sets a flag indicating if the slow JavaScript script should be interrupted in converter. The default value is false and the scripts are not interrupted- Parameters:
interrupt
- the flag value to set
-
renderedHtmlElementSelector
Gets the CSS selector of the HTML element to be rendered to PDF by converter- Returns:
- the selector of the HTML element to be rendered
-
setRenderedHtmlElementSelector
Gets or sets the CSS selector of the HTML element to be rendered to PDF by converter. If the selector selects multiple HTML elements, only the the first one will be converted. The CSS selector is case sensitive. If this property is not set then the entire HTML document is rendered- Parameters:
selector
- the CSS selector of the HTML element to be rendered to PDF
-
maxHtmlViewerHeight
public int maxHtmlViewerHeight()Gets the maximum height in pixels to be rendered from the HTML document by converter- Returns:
- the maximum height in pixels to be rendered from the HTML document
-
setMaxHtmlViewerHeight
public void setMaxHtmlViewerHeight(int maxHeight) Sets the maximum height in pixels to be rendered from the HTML document by converter. The default value is 0 and the entire HTML document is rendered- Parameters:
maxHeight
- the maximum height in pixels to be rendered from the HTML document
-
minHtmlViewerHeight
public int minHtmlViewerHeight()Gets the minimum height in pixels to be rendered from the HTML document by converter- Returns:
- the minimum height in pixels to be rendered from the HTML document
-
setMinHtmlViewerHeight
public void setMinHtmlViewerHeight(int minHeight) Sets the minimum height in pixels to be rendered from the HTML document by converter. The default value is 0 and the entire HTML document is rendered- Parameters:
minHeight
- the minimum height in pixels to be rendered from the HTML document
-
initialHtmlViewerHeight
public int initialHtmlViewerHeight()Gets the initial height in pixels of the HTML viewer in converter- Returns:
- the initial height in pixels of the HTML viewer
-
setInitialHtmlViewerHeight
public void setInitialHtmlViewerHeight(int initialHeight) Sets the initial height in pixels of the HTML viewer in converter. This value of this property is ignored if the HtmlViewerHeight property is set- Parameters:
initialHeight
- the initial height in pixels of the HTML viewer
-
defaultHtmlEncoding
Gets the default HTML document text encoding to be used if there is no charset meta tag defined in the HTML document- Returns:
- the default HTML document text encoding
-
setDefaultHtmlEncoding
Sets the default HTML document text encoding to be used if there is no charset meta tag defined in the HTML document- Parameters:
encoding
- the default HTML document text encoding
-
triggeringMode
Gets the conversion triggering mode used by converter- Returns:
- the conversion triggering mode
-
setTriggeringMode
Sets the conversion triggering mode used by converter- Parameters:
mode
- the conversion triggering mode
-
conversionDelay
public int conversionDelay()Gets the additional time in seconds to wait for asynchronous items to be completely loaded or for a web page redirect to finish before starting the rendering in converter. Default value is 2- Returns:
- the additional time in seconds to wait for asynchronous items to be completely loaded
-
setConversionDelay
public void setConversionDelay(int delay) Sets an additional time in seconds to wait for asynchronous items to be completely loaded or for a web page redirect to finish before starting the rendering in converter. Default value is 2- Parameters:
delay
- the additional time in seconds to wait for asynchronous items to be completely loaded
-
manualTriggeringConversionDelay
public int manualTriggeringConversionDelay()Gets the additional time in seconds to wait after manual triggering before starting the rendering. Default value is 2- Returns:
- the additional time in seconds to wait
-
setManualTriggeringConversionDelay
public void setManualTriggeringConversionDelay(int delay) Sets an additional time in seconds to wait after manual triggering before starting the rendering. Default value is 2- Parameters:
delay
- the additional time in seconds to wait
-
httpRequestHeaders
Gets a collection of custom HTTP headers to be sent by converter to the web server when the web page is requested from a URL. A custom HTTP header is defined by a name and a value pair that can be added tohttpRequestHeaders()
collection. ThepersistentHttpRequestHeaders()
property can be set on true to instruct the converter to send the custom headers each time an external resource (image, css, etc) referenced by the web page is requested. By default thepersistentHttpRequestHeaders()
property is false and the custom headers are not automatically sent to the web server when the web page resources are requested. The custom HTTP headers can be used to define cookies, authentication options, URL referrer or any other HTTP header to be sent to the web browser. The preferred method to send cookies is to use thehttpRequestCookies()
property- Returns:
- the collection of custom HTTP headers to be sent by the converter to the web server
-
persistentHttpRequestHeaders
public boolean persistentHttpRequestHeaders()Gets the flag indicating if the converter will send the custom headers defined by thehttpRequestHeaders()
property each time an external resource (image, css, etc) referenced by the web page is requested- Returns:
- the flag value
-
setPersistentHttpRequestHeaders
public void setPersistentHttpRequestHeaders(boolean persistentHttpRequestHeaders) Sets the flag indicating if the converter will send the custom headers defined by thehttpRequestHeaders()
property each time an external resource (image, css, etc) referenced by the web page is requested. The default value of this property is true and the custom headers are automatically sent to the web server when the web page resources are requested- Parameters:
persistentHttpRequestHeaders
- the flag value to set
-
httpRequestCookies
Gets a collection of custom HTTP cookies to be sent by converter to the web server when the web page to convert and the resources (image, css, etc) referenced by the web page are requested. A cookie is defined by a name and a value pair that can be added tohttpRequestCookies()
collection- Returns:
- the collection of custom HTTP cookies to be sent by converter to the web server when the web page to convert and the resources (image, css, etc) referenced by the web page are requested
-
convertUrl
Converts an URL to a SVG document and returns the rendered SVG document into a memory buffer- Parameters:
url
- the URL of the web page to be converted to PDF. The URL can be also the full path- Returns:
- a memory buffer containing the SVG document
- Throws:
Exception
- an exception is thrown if the conversion fails
-
convertHtml
Converts a HTML String into a SVG document using a base URL to resolve the external resources and returns the rendered SVG document into a memory buffer- Parameters:
html
- The HTML String to convert to SVGbaseUrl
- This parameter allows the converter to determine the full URLs from relative URLs for images and CSS files appearing in the HTML String. If there are not relative URLs in the HTML code this parameter can be empty or null- Returns:
- a memory buffer containing the SVG document
- Throws:
Exception
- an exception is thrown if the conversion fails
-
convertUrlToFile
Converts the specified URL into a SVG document and saves the rendered SVG document to the specified file- Parameters:
url
- The URL of the web page to be converted to PDF. The URL can be also the full path of a HTML file from the local file systemoutFile
- The output file where to save the generated SVG document- Throws:
Exception
- an exception is thrown if the conversion fails
-
convertHtmlToFile
Converts the specified HTML String into a SVG document using a base URL to resolve the external resources and saves the rendered SVG document to the specified file- Parameters:
html
- the HTML String to convertbaseUrl
- this parameter allows the converter to determine the full URLs from relative URLs for images and CSS files appearing in the HTML String. If there are not relative URLs in the HTML code this parameter can be empty or nulloutFile
- The output file where to save the generated SVG document- Throws:
Exception
- an exception is thrown if the conversion fails
-