@DOMObjectAttribute @DOMNameAttribute(name="SVGDocument") public class SVGDocument extends Document implements IDocumentEvent, IDocumentCSS
When an ‘svg’ element is embedded inline as a component of a document from another namespace, such as when an ‘svg’ element is embedded inline within an XHTML document [XHTML], then an SVGDocument object will not exist; instead, the root object in the document object hierarchy will be a Document object of a different type, such as an HTMLDocument object. However, an SVGDocument object will indeed exist when the root element of the XML document hierarchy is an ‘svg’ element, such as when viewing a stand-alone SVG file(i.e., a file with MIME type "image/svg+xml"). In this case, the SVGDocument object will be the root object of the document object model hierarchy.
Document
,
IDocumentEvent
Document.DocumentInit, Document.NavigationInit, Document.NavigationWorkItem
Node.Flags
CurrentScript, IgnoreDestructiveWritesCounter, OnAbort, OnAbortDelegate, OnBlur, OnBlurDelegate, OnCancel, OnCancelDelegate, OnCanplay, OnCanplayDelegate, OnCanPlayThrough, OnCanPlayThroughDelegate, OnChange, OnChangeDelegate, OnClick, OnClickDelegate, OnCueChange, OnCueChangeDelegate, OnDblClick, OnDblClickDelegate, OnDurationChange, OnDurationChangeDelegate, OnEmptied, OnEmptiedDelegate, OnEnded, OnEndedDelegate, OnError, OnErrorDelegate, OnFocus, OnFocusDelegate, OnInput, OnInputDelegate, OnInvalid, OnInvalidDelegate, OnKeyDown, OnKeyDownDelegate, OnKeyPress, OnKeyPressDelegate, OnKeyUp, OnKeyUpDelegate, OnLoad, OnLoadDelegate, OnLoadedData, OnLoadedDataDelegate, OnLoadedMetadata, OnLoadedMetadataDelegate, OnLoadStart, OnLoadStartDelegate, OnMouseDown, OnMouseDownDelegate, OnMouseEnter, OnMouseEnterDelegate, OnMouseLeave, OnMouseLeaveDelegate, OnMouseMove, OnMouseMoveDelegate, OnMouseOut, OnMouseOutDelegate, OnMouseOver, OnMouseOverDelegate, OnMouseUp, OnMouseUpDelegate, OnMouseWheel, OnMouseWheelDelegate, OnPause, OnPauseDelegate, OnPlay, OnPlayDelegate, OnPlaying, OnPlayingDelegate, OnProgress, OnProgressDelegate, OnRateChange, OnRateChangeDelegate, OnReadyStateChange, OnReadyStateChangeDelegate, OnReset, OnResetDelegate, OnResize, OnResizeDelegate, OnScroll, OnScrollDelegate, OnSeeked, OnSeekedDelegate, OnSeeking, OnSeekingDelegate, OnSelect, OnSelectDelegate, OnShow, OnShowDelegate, OnStalled, OnStalledDelegate, OnSubmit, OnSubmitDelegate, OnSuspend, OnSuspendDelegate, OnTimeUpdate, OnTimeUpdateDelegate, OnToggle, OnToggleDelegate, OnVolumeChange, OnVolumeChangeDelegate, OnWaiting, OnWaitingDelegate, PendingRarsingBlockingScript, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADING, revision, strCDataSectionName, strCommentName, strDocumentFragmentName, strDocumentName, strEntityName, strReservedXhtmlns, strReservedXml, strReservedXmlns, strSignificantWhitespaceName, strSpace, strTextName, strXml, strXmlns
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, flags, nodeDocument, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
EventMap
PropertyChanged
Constructor and Description |
---|
SVGDocument()
Initializes a new instance of the
SVGDocument class. |
SVGDocument(com.aspose.html.BrowsingContext context)
Initializes a new instance of the
HTMLDocument class. |
SVGDocument(Configuration configuration)
Initializes a new instance of the
SVGDocument class. |
SVGDocument(RequestMessage request)
Initializes a new instance of the
SVGDocument class. |
SVGDocument(RequestMessage request,
Configuration configuration)
Initializes a new instance of the
SVGDocument class. |
SVGDocument(com.aspose.html.internal.ms.System.IO.Stream content,
String baseUri)
Initializes a new instance of the
SVGDocument class. |
SVGDocument(com.aspose.html.internal.ms.System.IO.Stream content,
String baseUri,
Configuration configuration)
Initializes a new instance of the
SVGDocument class. |
SVGDocument(String address)
Initializes a new instance of the
SVGDocument class. |
SVGDocument(String address,
Configuration configuration)
Initializes a new instance of the
SVGDocument class. |
SVGDocument(String content,
String baseUri)
Initializes a new instance of the
SVGDocument class. |
SVGDocument(String content,
String baseUri,
Configuration configuration)
Initializes a new instance of the
SVGDocument class. |
SVGDocument(Url url)
Initializes a new instance of the
SVGDocument class. |
SVGDocument(Url url,
Configuration configuration)
Initializes a new instance of the
SVGDocument class. |
Modifier and Type | Method and Description |
---|---|
String |
getDomain()
The domain name of the server that served the document, or a null string if the server cannot be identified by a domain name.
|
ICSSStyleDeclaration |
getOverrideStyle(Element elt,
String pseudoElt)
This method is used to retrieve the override style declaration for a specified element and a specified pseudo-element.
|
String |
getReferrer()
Returns the URI of the page that linked to this page.
|
SVGSVGElement |
getRootElement()
The root ‘svg’ in the document hierarchy.
|
String |
getTitle()
The title of a document as specified by the ‘title’ sub-element of the ‘svg’ root element (i.e., {@code
|
String |
getURL()
The complete URI of the document.
|
void |
renderTo(IDevice device)
This method is used to print the contents of the current document to the specified device.
|
void |
save(String path)
Saves the document to local file specified by
path . |
void |
save(String path,
int saveFormat)
Saves the document to local file specified by
path . |
void |
save(String path,
SVGSaveOptions saveOptions)
Saves the document to local file specified by
path . |
void |
save(Url url)
Saves the document to local file specified by
url . |
void |
save(Url url,
int saveFormat)
Saves the document to local file specified by
url . |
void |
save(Url url,
SVGSaveOptions saveOptions)
Saves the document to local file specified by
url . |
adoptNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createDocumentType, createElement, createElementNS, createEntityReference, createEvent, createExpression, createNodeIterator, createNSResolver, createProcessingInstruction, createTextNode, createTreeWalker, evaluate, getBaseURI, getBrowsingContext, getCharacterSet, getCharset, getChildElementCount, getChildren, getComputedStyle, getContentType, getContext, getCookies, getDefaultView, getDoctype, getDocumentElement, getDocumentURI, getElementById, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getImplementation, getInputEncoding, getIterators, getLastElementChild, getLocation, getMimeType, getNameTable, getNextElementSibling, getNodeName, getNodeType, getOrigin, getOwnerDocument, getParser, getPreviousElementSibling, getQuirksMode, getReadyState, getStrictErrorChecking, getStyleContainer, getStyleSheets, getXmlStandalone, getXmlVersion, importNode, navigate, navigate, navigate, navigate, navigate, navigate, querySelector, querySelectorAll, setContentType, setLocation, setQuirksMode, setReadyState, setStrictErrorChecking, setXmlStandalone, setXmlVersion, write, writeLn
adoptNode, appendChild, cloneNode, deepClone, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getParentElement, getParentNode, getPrefix, getPreviousSibling, getRegisteredObservers, getTextContent, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceAll, replaceChild, setNodeValue, setParentNode, setPrefix, setTextContent, toString
addEventListener, addEventListener, addEventListener, addEventListener, dispatchEvent, dispose, removeEventListener, removeEventListener, removeEventListener
fireNotifyPropertyChanged, getCurrentValues, getRuntimesBinding, setCurrentValues, setField, setRuntimesBinding
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
createEvent
getStyleSheets
public SVGDocument()
Initializes a new instance of the SVGDocument
class.
public SVGDocument(Configuration configuration)
Initializes a new instance of the SVGDocument
class.
configuration
- The configuration.public SVGDocument(String address)
Initializes a new instance of the SVGDocument
class. Constructor works synchronously, it waits for loading of all the external resources (images, scripts, etc.).
To load document asynchronously use method Document.navigate(String)
or its overloads.
Or you can disable loading of some external resources by setting appropriate flags in IBrowsingContext.Security
(IBrowsingContext.getSecurity()
).
address
- The address.public SVGDocument(Url url)
Initializes a new instance of the SVGDocument
class. Constructor works synchronously, it waits for loading of all the external resources (images, scripts, etc.).
To load document asynchronously use method Document.navigate(Url)
or its overloads.
Or you can disable loading of some external resources by setting appropriate flags in IBrowsingContext.Security
(IBrowsingContext.getSecurity()
).
url
- The document URL.public SVGDocument(String address, Configuration configuration)
Initializes a new instance of the SVGDocument
class. Constructor works synchronously, it waits for loading of all the external resources (images, scripts, etc.).
To load document asynchronously use method Document.navigate(String)
or its overloads.
Or you can disable loading of some external resources by setting appropriate flags in IBrowsingContext.Security
(IBrowsingContext.getSecurity()
).
address
- The address.configuration
- The configuration.public SVGDocument(Url url, Configuration configuration)
Initializes a new instance of the SVGDocument
class. Constructor works synchronously, it waits for loading of all the external resources (images, scripts, etc.).
To load document asynchronously use method Document.navigate(Url)
or its overloads.
Or you can disable loading of some external resources by setting appropriate flags in IBrowsingContext.Security
(IBrowsingContext.getSecurity()
).
url
- The document URL.configuration
- The configuration.public SVGDocument(com.aspose.html.internal.ms.System.IO.Stream content, String baseUri)
Initializes a new instance of the SVGDocument
class. Constructor works synchronously, it waits for loading of all the external resources (images, scripts, etc.).
To load document asynchronously use method Document.navigate(Stream, String)
or its overloads.
Or you can disable loading of some external resources by setting appropriate flags in IBrowsingContext.Security
(IBrowsingContext.getSecurity()
).
content
- The document content.baseUri
- The base URI of the document.com.aspose.html.internal.ms.System.ArgumentNullException
- baseUri
is null
.public SVGDocument(com.aspose.html.internal.ms.System.IO.Stream content, String baseUri, Configuration configuration)
Initializes a new instance of the SVGDocument
class. Constructor works synchronously, it waits for loading of all the external resources (images, scripts, etc.).
To load document asynchronously use method Document.navigate(Stream, String)
or its overloads.
Or you can disable loading of some external resources by setting appropriate flags in IBrowsingContext.Security
(IBrowsingContext.getSecurity()
).
content
- The document content.baseUri
- The base URI of the document.configuration
- The configuration.com.aspose.html.internal.ms.System.ArgumentNullException
- baseUri
is null
.public SVGDocument(String content, String baseUri)
Initializes a new instance of the SVGDocument
class. Constructor works synchronously, it waits for loading of all the external resources (images, scripts, etc.).
To load document asynchronously use method Document.navigate(String, String)
or its overloads.
Or you can disable loading of some external resources by setting appropriate flags in IBrowsingContext.Security
(IBrowsingContext.getSecurity()
).
content
- The document content.baseUri
- The base URI of the document.com.aspose.html.internal.ms.System.ArgumentNullException
- baseUri
is null
.public SVGDocument(String content, String baseUri, Configuration configuration)
Initializes a new instance of the SVGDocument
class. Constructor works synchronously, it waits for loading of all the external resources (images, scripts, etc.).
To load document asynchronously use method Document.navigate(String, String)
or its overloads.
Or you can disable loading of some external resources by setting appropriate flags in IBrowsingContext.Security
(IBrowsingContext.getSecurity()
).
content
- The document content.baseUri
- The base URI of the document.configuration
- The configuration.com.aspose.html.internal.ms.System.ArgumentNullException
- baseUri
is null
.public SVGDocument(RequestMessage request)
Initializes a new instance of the SVGDocument
class. Constructor works synchronously, it waits for loading of all the external resources (images, scripts, etc.).
To load document asynchronously use method Document.navigate(RequestMessage)
or its overloads.
Or you can disable loading of some external resources by setting appropriate flags in IBrowsingContext.Security
(IBrowsingContext.getSecurity()
).
request
- The request.public SVGDocument(RequestMessage request, Configuration configuration)
Initializes a new instance of the SVGDocument
class. Constructor works synchronously, it waits for loading of all the external resources (images, scripts, etc.).
To load document asynchronously use method Document.navigate(RequestMessage)
or its overloads.
Or you can disable loading of some external resources by setting appropriate flags in IBrowsingContext.Security
(IBrowsingContext.getSecurity()
).
request
- The request.configuration
- The configuration.public SVGDocument(com.aspose.html.BrowsingContext context)
Initializes a new instance of the HTMLDocument
class.
context
- The context.@DOMNameAttribute(name="title") public String getTitle()
The title of a document as specified by the ‘title’ sub-element of the ‘svg’ root element (i.e., <svg><title>Here is the title</title>...</svg>
)
@DOMNameAttribute(name="referrer") public String getReferrer()
Returns the URI of the page that linked to this page. The value is an empty string if the user navigated to the page directly (not through a link, but, for example, via a bookmark).
Value: The referrer.@DOMNameAttribute(name="domain") public String getDomain()
The domain name of the server that served the document, or a null string if the server cannot be identified by a domain name.
Value: The domain.@DOMNameAttribute(name="URL") public String getURL()
The complete URI of the document.
Value: The URL.@DOMNameAttribute(name="rootElement") public SVGSVGElement getRootElement()
The root ‘svg’ in the document hierarchy.
Value: The root element.public void save(Url url)
Saves the document to local file specified by url
. All resources used in this document will be saved in
to adjacent folder, whose name will be constructed as: output_file_name + "_files".
url
- Local URL to output file.com.aspose.html.internal.ms.System.ArgumentException
- Raised if the specified url
is not a valid local file URL.public void save(String path)
Saves the document to local file specified by path
. All resources used in this document will be saved in
to adjacent folder, whose name will be constructed as: output_file_name + "_files".
path
- Local path to output file.com.aspose.html.internal.ms.System.ArgumentException
- Raised if the specified path
is not a valid local file path.public void save(String path, int saveFormat)
Saves the document to local file specified by path
. All resources used in this document will be saved in
to adjacent folder, whose name will be constructed as: output_file_name + "_files".
path
- Local path to output file.saveFormat
- Format in which document is saved.com.aspose.html.internal.ms.System.ArgumentException
- Raised if the specified path
is not a valid local file path.public void save(String path, SVGSaveOptions saveOptions)
Saves the document to local file specified by path
. All resources used in this document will be saved in
to adjacent folder, whose name will be constructed as: output_file_name + "_files".
path
- Local path to output file.saveOptions
- SVG save options.com.aspose.html.internal.ms.System.ArgumentException
- Raised if the specified path
is not a valid local file path.public void save(Url url, int saveFormat)
Saves the document to local file specified by url
. All resources used in this document will be saved in
to adjacent folder, whose name will be constructed as: output_file_name + "_files".
url
- Local URL to output file.saveFormat
- Format in which document is saved.com.aspose.html.internal.ms.System.ArgumentException
- Raised if the specified url
is not a valid local file URL.public void save(Url url, SVGSaveOptions saveOptions)
Saves the document to local file specified by url
. All resources used in this document will be saved in
to adjacent folder, whose name will be constructed as: output_file_name + "_files".
url
- Local URL to output file.saveOptions
- SVG save options.com.aspose.html.internal.ms.System.ArgumentException
- Raised if the specified url
is not a valid local file URL.public void renderTo(IDevice device)
This method is used to print the contents of the current document to the specified device.
public ICSSStyleDeclaration getOverrideStyle(Element elt, String pseudoElt)
This method is used to retrieve the override style declaration for a specified element and a specified pseudo-element.
getOverrideStyle
in interface IDocumentCSS
elt
- The element whose style is to be modified. This parameter cannot be null.pseudoElt
- The pseudo-element or null if none.