Class SVGDocument
名称: Aspose.Svg 會議: Aspose.SVG.dll (25.5.0)
一个“SVGD文件”是 SVG 序列的根,并保留了整个内容。 除此之外,它还提供了对 hierarchy 的访问, 它还提供了一些方便的方法,以便从文档中获取某些信息。 构建者和Aspose.Svg.Dom .Document.Navigate(System.String)方法都可以加载 gzip 压缩的 .svgz 文件。 例如,当一个“svg”元素在XHTML文档中内嵌入, 因此,SGD文件对象将不存在; 而不是, 文档对象序列中的根物体将是一个不同类型的文件对体, 例如,HTMLDocument object.H, 一个 SVGD文件对象实际上会存在,当 XML 文档序列的根元素是“svg”元件时, 例如,当您查看单独的 SVG 文件时(即: 文件具有 MIME 类型“image/svg+xml”的文件。 在这种情况下, SVGD文件对象将是文档物体模型序列的根对称。
[ComVisible(true)]
[DOMObject]
[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.Svg。SVGD文件类的新例子。
public SVGDocument()
文档(Configuration)
启动了 Aspose.Svg。SVGD文件类的新例子。
public SVGDocument(Configuration configuration)
Parameters
configuration
Configuration
是配置。
文档(线条)
创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。用于无与伦比地加载文档,使用 Aspose.Svg.Dom .Document.Navigate(System.String) 或其过载方法。或者您可以通过在 Aspose.Svg.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。
public SVGDocument(string address)
Parameters
address
string
文件地址. 它将与当前的目录路径相结合,形成一个绝对的URL。
文档(Url)
创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Svg .Dom.Document.Navigate(Aspose。或者您可以通过在 Aspose.Svg.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。
public SVGDocument(Url url)
Parameters
url
Url
文件URL。
文档(字符串,配置)
创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。用于无与伦比地加载文档,使用 Aspose.Svg.Dom .Document.Navigate(System.String) 或其过载方法。或者您可以通过在 Aspose.Svg.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。
public SVGDocument(string address, Configuration configuration)
Parameters
address
string
文件地址. 它将与当前的目录路径相结合,形成一个绝对的URL。
configuration
Configuration
是配置。
文档(URL 设置)
创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Svg .Dom.Document.Navigate(Aspose。或者您可以通过在 Aspose.Svg.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。
public SVGDocument(Url url, Configuration configuration)
Parameters
url
Url
文件URL。
configuration
Configuration
是配置。
文档(流, string)
创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Svg .Dom.Document.Navigate(System.IO.Stream、Sistem.String)或其超级加载。或者您可以通过在 Aspose.Svg.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。文档加载从流中的当前位置开始。
public SVGDocument(Stream content, string baseUri)
Parameters
content
Stream
文件内容。
baseUri
string
文档的基 URI 将与当前的目录路径相结合,形成一个绝对的 URL。
Exceptions
“BaseUri”是“零”。
文档(电流、线条、配置)
创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Svg .Dom.Document.Navigate(System.IO.Stream、Sistem.String)或其超级加载。或者您可以通过在 Aspose.Svg.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。文档加载从流中的当前位置开始。
public SVGDocument(Stream content, string baseUri, Configuration configuration)
Parameters
content
Stream
文件内容。
baseUri
string
文档的基 URI 将与当前的目录路径相结合,形成一个绝对的 URL。
configuration
Configuration
是配置。
Exceptions
“BaseUri”是“零”。
文档(流,URL)
创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Svg .Dom.Document.Navigate(System.IO.Stream、Aspose。或者您可以通过在 Aspose.Svg.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。文档加载从流中的当前位置开始。
public SVGDocument(Stream content, Url baseUri)
Parameters
content
Stream
文件内容。
baseUri
Url
文档的基 URI。
Exceptions
“BaseUri”是“零”。
文档(流、URL、配置)
创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Svg .Dom.Document.Navigate(System.IO.Stream、Aspose。或者您可以通过在 Aspose.Svg.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。文档加载从流中的当前位置开始。
public SVGDocument(Stream content, Url baseUri, Configuration configuration)
Parameters
content
Stream
文件内容。
baseUri
Url
文档的基 URI。
configuration
Configuration
是配置。
Exceptions
“BaseUri”是“零”。
文档(字符串, string)
创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Svg .Dom.Document.Navigate(System.String、Sistem. String) 或其加载。或者您可以通过在 Aspose.Svg.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。
public SVGDocument(string content, string baseUri)
Parameters
content
string
文件内容。
baseUri
string
文档的基 URI 将与当前的目录路径相结合,形成一个绝对的 URL。
Exceptions
“BaseUri”是“零”。
文档(字符串、字符串、配置)
创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Svg .Dom.Document.Navigate(System.String、Sistem. String) 或其加载。或者您可以通过在 Aspose.Svg.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。
public SVGDocument(string content, string baseUri, Configuration configuration)
Parameters
content
string
文件内容。
baseUri
string
文档的基 URI 将与当前的目录路径相结合,形成一个绝对的 URL。
configuration
Configuration
是配置。
Exceptions
“BaseUri”是“零”。
文档(字符串,URL)
创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Svg .Dom.Document.Navigate(System.String、Aspose。或者您可以通过在 Aspose.Svg.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。
public SVGDocument(string content, Url baseUri)
Parameters
content
string
文件内容。
baseUri
Url
文档的基 URI。
Exceptions
“BaseUri”是“零”。
文档(字符串、URL、配置)
创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Svg .Dom.Document.Navigate(System.String、Aspose。或者您可以通过在 Aspose.Svg.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。
public SVGDocument(string content, Url baseUri, Configuration configuration)
Parameters
content
string
文件内容。
baseUri
Url
文档的基 URI。
configuration
Configuration
是配置。
Exceptions
“BaseUri”是“零”。
文档(RequestMessage)
创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Svg .Dom.Document.Navigate(Aspose .SVg.Net.RequestMessage)或其过载方法以无同步地加载文档。或者您可以通过在 Aspose.Svg.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。
public SVGDocument(RequestMessage request)
Parameters
request
RequestMessage
请求。
文档(RequestMessage, 配置)
创建者以同步方式工作,等待所有外部资源(图像、脚本等)的加载。使用 Aspose.Svg .Dom.Document.Navigate(Aspose .SVg.Net.RequestMessage)或其过载方法以无同步地加载文档。或者您可以通过在 Aspose.Svg.Dom.IBrowsingContext.Security 中设置适当的旗帜来禁用某些外部资源的加载。
public SVGDocument(RequestMessage request, Configuration configuration)
Parameters
request
RequestMessage
请求。
configuration
Configuration
是配置。
Properties
Domain
服务器服务器的域名,或者服务器无法通过域名识别的零字符串。
[DOMName("domain")]
public string Domain { get; }
财产价值
Referrer
返回链接到此页面的 URI. 值是用户直接导航到页面时的空行(不是通过链接,而是通过图标)。
[DOMName("referrer")]
public string Referrer { get; }
财产价值
RootElement
文档层中的“svg”根。
[DOMName("rootElement")]
public SVGSVGElement RootElement { get; }
财产价值
Title
文档的标题,如“头”根元素(即“svg”)的子元格所规定的。 )
[DOMName("title")]
public string Title { get; }
财产价值
URL
文件的完整URI。
[DOMName("URL")]
public string URL { get; }
财产价值
Methods
GetOverrideStyle(元素, string)
这种方法是用来获取一个特定的元素和一个特定的假元素的超级风格声明。
public ICSSStyleDeclaration GetOverrideStyle(Element elt, string pseudoElt)
Parameters
elt
Element
该元素的风格要修改,这个参数不能为零。
pseudoElt
string
假冒元素或零,如果没有。
Returns
超级风格宣言
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
如果所指定的“URL”不是有效的本地文件URL。
Save(线条)
将文档存储到“路径”所指定的本地文件中,此文中使用的所有资源将保存到附近的文件夹,其名称将以: output_file_name + “_files” 构建。
public void Save(string path)
Parameters
path
string
路线到输出文件。
Exceptions
如果指定的“路径”不是有效的本地文件路径。
Save(ResourceHandler)
存储文档内容和资源,使用 Aspose.Svg。Saving.ResourceHandlers。
public void Save(ResourceHandler resourceHandler)
Parameters
resourceHandler
ResourceHandler
资源交易者:Svg.Saving.ResourceHandlers。
Save(字符串, SVGSaveFormat)
将文档存储到“路径”所指定的本地文件中,此文中使用的所有资源将保存到附近的文件夹,其名称将以: output_file_name + “_files” 构建。
public void Save(string path, SVGSaveFormat saveFormat)
Parameters
path
string
路线到输出文件。
saveFormat
SVGSaveFormat
文件存储的格式。
Exceptions
如果指定的“路径”不是有效的本地文件路径。
Save(字符串, SVGSaveFormat , SVGSaveOptions)
存储文档内容和相关资源到指定的文件路径。
public void Save(string path, SVGSaveFormat saveFormat, SVGSaveOptions saveOptions)
Parameters
path
string
文件路径,文件将被保存。
saveFormat
SVGSaveFormat
该文件应该保存的格式。
saveOptions
SVGSaveOptions
指定储蓄的额外参数的选项,如 vectorization 偏好。
Save(资源经销商,SVGSaveFormat)
存储文档内容和资源,使用 Aspose.Svg。Saving.ResourceHandlers。
public void Save(ResourceHandler resourceHandler, SVGSaveFormat saveFormat)
Parameters
resourceHandler
ResourceHandler
资源交易者:Svg.Saving.ResourceHandlers。
saveFormat
SVGSaveFormat
文件存储的格式。
Save(资源经销商,SVGSaveFormat,SSVGaveOptions)
存储文档内容和相关资源,使用所指定的 Aspose.Svg。Saving.ResourceHandlers。
public void Save(ResourceHandler resourceHandler, SVGSaveFormat saveFormat, SVGSaveOptions saveOptions)
Parameters
resourceHandler
ResourceHandler
资源处理者管理文档资源,如文件系统或基于记忆的存储。
saveFormat
SVGSaveFormat
该文件应该保存的格式。
saveOptions
SVGSaveOptions
指定额外的储蓄参数的选项,如 vectorization 偏好。
Save(字符串, SVGSaveOptions)
将文档存储到“路径”所指定的本地文件中. 本文中使用的所有资源将被保存到附近的文件夹中,其名称将以: output_file_name + “_files” 构建。
public void Save(string path, SVGSaveOptions saveOptions)
Parameters
path
string
路线到输出文件。
saveOptions
SVGSaveOptions
SVG 节省选项
Exceptions
如果指定的“路径”不是有效的本地文件路径。
Save(资源经销商, SVGSaveOptions)
存储文档内容和资源,使用 Aspose.Svg。Saving.ResourceHandlers。
public void Save(ResourceHandler resourceHandler, SVGSaveOptions saveOptions)
Parameters
resourceHandler
ResourceHandler
资源交易者:Svg.Saving.ResourceHandlers。
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
如果所指定的“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
如果所指定的“URL”不是有效的本地文件URL。
Save(此分類上一篇: SVGSaveFormat, SVGSaveOptions)
将文档内容和相关资源存储到指定的 Aspose.Svg.Url。
public void Save(Url url, SVGSaveFormat saveFormat, SVGSaveOptions saveOptions)
Parameters
url
Url
目标是 Aspose.Svg.Url 在那里文件将被保存。
saveFormat
SVGSaveFormat
该文件应该保存的格式。
saveOptions
SVGSaveOptions
指定储蓄的额外参数的选项,如 vectorization 偏好。