Class SVGDocument

Class SVGDocument

名称: Aspose.Html.Dom.Svg 编辑: Aspose.HTML.dll (25.4.0)

除此之外,它还提供了一些方便的方法,以便从文档中获取某些信息集。当一个“svg”元素作为一个文档的组成部分从另一个名称空间内嵌入时,例如当一个“svg”元素在XHTML文档(XHTML)中嵌入时,那么一个SVGD文档对象将不会存在;相反,文档对象的根对象将是一个不同类型的文档对象,如HTML文档对象。

[DOMObject]
[ComVisible(true)]
[DOMName("SVGDocument")]
public class SVGDocument : Document, INotifyPropertyChanged, IEventTarget, IDisposable, IXPathNSResolver, IDocumentTraversal, IXPathEvaluator, IParentNode, IElementTraversal, INonElementParentNode, IGlobalEventHandlers, IDocumentEvent, IDocumentCSS, IDocumentStyle

Inheritance

object DOMObject EventTarget Node Document SVGDocument

Implements

INotifyPropertyChanged , IEventTarget , IDisposable , IXPathNSResolver , IDocumentTraversal , IXPathEvaluator , IParentNode , IElementTraversal , INonElementParentNode , IGlobalEventHandlers , IDocumentEvent , IDocumentCSS , IDocumentStyle

继承人

Document.Navigate(string) , Document.Navigate(Url) , Document.Navigate(string, string) , Document.Navigate(string, Url) , Document.Navigate(Stream, string) , Document.Navigate(Stream, Url) , Document.Navigate(RequestMessage) , Document.CreateElement(string) , Document.CreateElementNS(string, string) , Document.CreateDocumentFragment() , Document.CreateTextNode(string) , Document.CreateComment(string) , Document.CreateCDATASection(string) , Document.CreateProcessingInstruction(string, string) , Document.CreateAttribute(string) , Document.CreateAttributeNS(string, string) , Document.CreateEntityReference(string) , Document.CreateDocumentType(string, string, string, string) , Document.GetElementsByTagName(string) , Document.GetElementsByTagNameNS(string, string) , Document.GetElementById(string) , Document.GetElementsByClassName(string) , Document.CreateNodeIterator(Node) , Document.CreateNodeIterator(Node, long) , Document.CreateNodeIterator(Node, long, INodeFilter) , Document.CreateTreeWalker(Node) , Document.CreateTreeWalker(Node, long) , Document.CreateTreeWalker(Node, long, INodeFilter) , Document.QuerySelectorAll(string) , Document.QuerySelector(string) , Document.ImportNode(Node, bool) , Document.CreateEvent(string) , Document.Write(params string[]) , Document.WriteLn(params string[]) , Document.CreateExpression(string, IXPathNSResolver) , Document.CreateNSResolver(Node) , Document.Evaluate(string, Node, IXPathNSResolver, XPathResultType, object) , Document.RenderTo(IDevice) , Document.Dispose(bool) , Document.OwnerDocument , Document.Context , Document.Implementation , Document.Location , Document.DocumentURI , Document.Origin , Document.BaseURI , Document.NodeName , Document.NodeType , Document.CharacterSet , Document.Charset , Document.InputEncoding , Document.ContentType , Document.ReadyState , Document.Doctype , Document.DocumentElement , Document.FirstElementChild , Document.LastElementChild , Document.PreviousElementSibling , Document.NextElementSibling , Document.ChildElementCount , Document.Children , Document.XmlStandalone , Document.XmlVersion , Document.StrictErrorChecking , Document.DefaultView , Document.StyleSheets , Document.OnReadyStateChange , Document.OnAbort , Document.OnBlur , Document.OnCancel , Document.OnCanplay , Document.OnCanPlayThrough , Document.OnChange , Document.OnClick , Document.OnCueChange , Document.OnDblClick , Document.OnDurationChange , Document.OnEmptied , Document.OnEnded , Document.OnError , Document.OnFocus , Document.OnInput , Document.OnInvalid , Document.OnKeyDown , Document.OnKeyPress , Document.OnKeyUp , Document.OnLoad , Document.OnLoadedData , Document.OnLoadedMetadata , Document.OnLoadStart , Document.OnMouseDown , Document.OnMouseEnter , Document.OnMouseLeave , Document.OnMouseMove , Document.OnMouseOut , Document.OnMouseOver , Document.OnMouseUp , Document.OnMouseWheel , Document.OnPause , Document.OnPlay , Document.OnPlaying , Document.OnProgress , Document.OnRateChange , Document.OnReset , Document.OnResize , Document.OnScroll , Document.OnSeeked , Document.OnSeeking , Document.OnSelect , Document.OnShow , Document.OnStalled , Document.OnSubmit , Document.OnSuspend , Document.OnTimeUpdate , Document.OnToggle , Document.OnVolumeChange , Document.OnWaiting , Node.ELEMENT_NODE , Node.ATTRIBUTE_NODE , Node.TEXT_NODE , Node.CDATA_SECTION_NODE , Node.ENTITY_REFERENCE_NODE , Node.ENTITY_NODE , Node.PROCESSING_INSTRUCTION_NODE , Node.COMMENT_NODE , Node.DOCUMENT_NODE , Node.DOCUMENT_TYPE_NODE , Node.DOCUMENT_FRAGMENT_NODE , Node.NOTATION_NODE , Node.HasChildNodes() , Node.Normalize() , Node.CloneNode() , Node.CloneNode(bool) , Node.IsEqualNode(Node) , Node.IsSameNode(Node) , Node.LookupPrefix(string) , Node.LookupNamespaceURI(string) , Node.IsDefaultNamespace(string) , Node.InsertBefore(Node, Node) , Node.ReplaceChild(Node, Node) , Node.RemoveChild(Node) , Node.AppendChild(Node) , Node.Dispose(bool) , Node.ToString() , Node.NodeType , Node.LocalName , Node.NamespaceURI , Node.Prefix , Node.NodeName , Node.BaseURI , Node.OwnerDocument , Node.ParentNode , Node.ParentElement , Node.ChildNodes , Node.FirstChild , Node.LastChild , Node.PreviousSibling , Node.NextSibling , Node.NodeValue , Node.TextContent , EventTarget.AddEventListener(string, DOMEventHandler, bool) , EventTarget.AddEventListener(string, IEventListener) , EventTarget.AddEventListener(string, IEventListener, bool) , EventTarget.RemoveEventListener(string, DOMEventHandler, bool) , EventTarget.RemoveEventListener(string, IEventListener) , EventTarget.RemoveEventListener(string, IEventListener, bool) , EventTarget.DispatchEvent(Event) , EventTarget.Dispose() , EventTarget.Dispose(bool) , DOMObject.GetPlatformType() , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

文档()

启动了 Aspose.Html.Dom.Svg.SVGD文件类的新例子。

public SVGDocument()

文档(Configuration)

启动了 Aspose.Html.Dom.Svg.SVGD文件类的新例子。

public SVGDocument(Configuration configuration)

Parameters

configuration Configuration

是配置。

文档(线条)

创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Html.Dom.Document.Navigate(System.String)或其加载方法以无同步地加载文档。或者您可以通过在 Aspose.Html.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。

public SVGDocument(string address)

Parameters

address string

文件地址. 它将与当前的目录路径相结合,形成一个绝对的URL。

文档(Url)

创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Html.Dom.Document.Navigate(Aspose.Html.Url)或其过载方法以无同步地加载文档。或者您可以通过在 Aspose.Html.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。

public SVGDocument(Url url)

Parameters

url Url

文件URL。

文档(字符串,配置)

创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Html.Dom.Document.Navigate(System.String)或其加载方法以无同步地加载文档。或者您可以通过在 Aspose.Html.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。

public SVGDocument(string address, Configuration configuration)

Parameters

address string

文件地址. 它将与当前的目录路径相结合,形成一个绝对的URL。

configuration Configuration

是配置。

文档(URL 设置)

创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Html.Dom.Document.Navigate(Aspose.Html.Url)或其过载方法以无同步地加载文档。或者您可以通过在 Aspose.Html.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。

public SVGDocument(Url url, Configuration configuration)

Parameters

url Url

文件URL。

configuration Configuration

是配置。

文档(流, string)

创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Html.Dom.Document.Navigate(System.IO.Stream,System.String)或其过载方法以无同步地加载文档。或者您可以通过在 Aspose.Html.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。文档加载从流中的当前位置开始。

public SVGDocument(Stream content, string baseUri)

Parameters

content Stream

文件内容。

baseUri string

文档的基 URI 将与当前的目录路径相结合,形成一个绝对的 URL。

Exceptions

ArgumentNullException

“BaseUri”是“零”。

文档(电流、线条、配置)

创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Html.Dom.Document.Navigate(System.IO.Stream,System.String)或其过载方法以无同步地加载文档。或者您可以通过在 Aspose.Html.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。文档加载从流中的当前位置开始。

public SVGDocument(Stream content, string baseUri, Configuration configuration)

Parameters

content Stream

文件内容。

baseUri string

文档的基 URI 将与当前的目录路径相结合,形成一个绝对的 URL。

configuration Configuration

是配置。

Exceptions

ArgumentNullException

“BaseUri”是“零”。

文档(流,URL)

创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Html.Dom.Document.Navigate(System.IO.Stream、Aspose.Html.Url)或其超级加载。或者您可以通过在 Aspose.Html.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。文档加载从流中的当前位置开始。

public SVGDocument(Stream content, Url baseUri)

Parameters

content Stream

文件内容。

baseUri Url

文档的基 URI。

Exceptions

ArgumentNullException

“BaseUri”是“零”。

文档(流、URL、配置)

创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Html.Dom.Document.Navigate(System.IO.Stream、Aspose.Html.Url)或其超级加载。或者您可以通过在 Aspose.Html.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。文档加载从流中的当前位置开始。

public SVGDocument(Stream content, Url baseUri, Configuration configuration)

Parameters

content Stream

文件内容。

baseUri Url

文档的基 URI。

configuration Configuration

是配置。

Exceptions

ArgumentNullException

“BaseUri”是“零”。

文档(字符串, string)

创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Html.Dom.Document.Navigate(System.String、System.String)或其超级加载。或者您可以通过在 Aspose.Html.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。

public SVGDocument(string content, string baseUri)

Parameters

content string

文件内容。

baseUri string

文档的基 URI 将与当前的目录路径相结合,形成一个绝对的 URL。

Exceptions

ArgumentNullException

“BaseUri”是“零”。

文档(字符串、字符串、配置)

创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Html.Dom.Document.Navigate(System.String、System.String)或其超级加载。或者您可以通过在 Aspose.Html.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。

public SVGDocument(string content, string baseUri, Configuration configuration)

Parameters

content string

文件内容。

baseUri string

文档的基 URI 将与当前的目录路径相结合,形成一个绝对的 URL。

configuration Configuration

是配置。

Exceptions

ArgumentNullException

“BaseUri”是“零”。

文档(字符串,URL)

创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Html.Dom.Document.Navigate(System.String、Aspose.Html.Url)或其超级加载。或者您可以通过在 Aspose.Html.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。

public SVGDocument(string content, Url baseUri)

Parameters

content string

文件内容。

baseUri Url

文档的基 URI。

Exceptions

ArgumentNullException

“BaseUri”是“零”。

文档(字符串、URL、配置)

创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Html.Dom.Document.Navigate(System.String、Aspose.Html.Url)或其超级加载。或者您可以通过在 Aspose.Html.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。

public SVGDocument(string content, Url baseUri, Configuration configuration)

Parameters

content string

文件内容。

baseUri Url

文档的基 URI。

configuration Configuration

是配置。

Exceptions

ArgumentNullException

“BaseUri”是“零”。

文档(RequestMessage)

创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Html.Dom.Document.Navigate(Aspose.Html.Net.RequestMessage)或其过载方法以无同步地加载文档。或者您可以通过在 Aspose.Html.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。

public SVGDocument(RequestMessage request)

Parameters

request RequestMessage

请求。

文档(RequestMessage, 配置)

创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Html.Dom.Document.Navigate(Aspose.Html.Net.RequestMessage)或其过载方法以无同步地加载文档。或者您可以通过在 Aspose.Html.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。

public SVGDocument(RequestMessage request, Configuration configuration)

Parameters

request RequestMessage

请求。

configuration Configuration

是配置。

Properties

Domain

服务器服务器的域名,或者服务器无法通过域名识别的零字符串。

[DOMName("domain")]
public string Domain { get; }

财产价值

string

Referrer

返回链接到此页面的 URI. 值是用户直接导航到页面时的空行(不是通过链接,而是通过图标)。

[DOMName("referrer")]
public string Referrer { get; }

财产价值

string

RootElement

文档层中的“svg”根。

[DOMName("rootElement")]
public SVGSVGElement RootElement { get; }

财产价值

SVGSVGElement

Title

文档的标题,如“头”根元素(即“svg”)的子元格所规定的。 这里是标题)

[DOMName("title")]
public string Title { get; }

财产价值

string

URL

文件的完整URI。

[DOMName("URL")]
public string URL { get; }

财产价值

string

Methods

GetOverrideStyle(元素, string)

这种方法是用来获取一个特定的元素和一个特定的假元素的超级风格声明。

public ICSSStyleDeclaration GetOverrideStyle(Element elt, string pseudoElt)

Parameters

elt Element

该元素的风格要修改,这个参数不能为零。

pseudoElt string

假冒元素或零,如果没有。

Returns

ICSSStyleDeclaration

超级风格宣言

RenderTo(偶像)

此方法用于将当前文档的内容印刷到指定的设备上。

public override void RenderTo(IDevice device)

Parameters

device IDevice

用户设备。

Save(Url)

将文档存储到“URL”所指定的本地文件中,所有在文档中使用的资源将存储到附近的文件夹中,其名称将以: output_file_name + “_files” 构建。

public void Save(Url url)

Parameters

url Url

URL 到输出文件。

Exceptions

ArgumentException

如果所指定的“URL”不是有效的本地文件URL。

Save(线条)

将文档存储到“路径”所指定的本地文件中,所有在文档中使用的资源将存储到附近的文件夹中,其名称将以: output_file_name + “_files” 构建。

public void Save(string path)

Parameters

path string

路线到输出文件。

Exceptions

ArgumentException

如果指定的“路径”不是有效的本地文件路径。

Save(ResourceHandler)

保存文档内容和资源,使用 Aspose.Html.Saving.ResourceHandlers.ResourceHandler。

public void Save(ResourceHandler resourceHandler)

Parameters

resourceHandler ResourceHandler

资源交易者:Html.Saving.ResourceHandlers.ResourceHandler。

Save(字符串, SVGSaveFormat)

将文档存储到“路径”所指定的本地文件中,所有在文档中使用的资源将存储到附近的文件夹中,其名称将以: output_file_name + “_files” 构建。

public void Save(string path, SVGSaveFormat saveFormat)

Parameters

path string

路线到输出文件。

saveFormat SVGSaveFormat

文件存储的格式。

Exceptions

ArgumentException

如果指定的“路径”不是有效的本地文件路径。

Save(资源经销商,SVGSaveFormat)

保存文档内容和资源,使用 Aspose.Html.Saving.ResourceHandlers.ResourceHandler。

public void Save(ResourceHandler resourceHandler, SVGSaveFormat saveFormat)

Parameters

resourceHandler ResourceHandler

资源交易者:Html.Saving.ResourceHandlers.ResourceHandler。

saveFormat SVGSaveFormat

文件存储的格式。

Save(字符串, SVGSaveOptions)

将文档存储到“路径”所指定的本地文件中,所有在文档中使用的资源将存储到附近的文件夹中,其名称将以: output_file_name + “_files” 构建。

public void Save(string path, SVGSaveOptions saveOptions)

Parameters

path string

路线到输出文件。

saveOptions SVGSaveOptions

SVG 节省选项

Exceptions

ArgumentException

如果指定的“路径”不是有效的本地文件路径。

Save(资源经销商, SVGSaveOptions)

保存文档内容和资源,使用 Aspose.Html.Saving.ResourceHandlers.ResourceHandler。

public void Save(ResourceHandler resourceHandler, SVGSaveOptions saveOptions)

Parameters

resourceHandler ResourceHandler

资源交易者:Html.Saving.ResourceHandlers.ResourceHandler。

saveOptions SVGSaveOptions

SVG 节省选项

Save(URL 和 SVGSaveFormat)

将文档存储到“URL”所指定的本地文件中,所有在文档中使用的资源将存储到附近的文件夹中,其名称将以: output_file_name + “_files” 构建。

public void Save(Url url, SVGSaveFormat saveFormat)

Parameters

url Url

URL 到输出文件。

saveFormat SVGSaveFormat

文件存储的格式。

Exceptions

ArgumentException

如果所指定的“URL”不是有效的本地文件URL。

Save(URL 和 SVGSaveOptions)

将文档存储到“URL”所指定的本地文件中,所有在文档中使用的资源将存储到附近的文件夹中,其名称将以: output_file_name + “_files” 构建。

public void Save(Url url, SVGSaveOptions saveOptions)

Parameters

url Url

URL 到输出文件。

saveOptions SVGSaveOptions

SVG 节省选项

Exceptions

ArgumentException

如果所指定的“URL”不是有效的本地文件URL。

看也

Document , IDocumentEvent

 中文