com.aspose.html.dom.svg

Class SVGDocument

    • Constructor Detail

      • SVGDocument

        public SVGDocument()

        Initializes a new instance of the SVGDocument class.

      • SVGDocument

        public SVGDocument(Configuration configuration)

        Initializes a new instance of the SVGDocument class.

        Parameters:
        configuration - The configuration.
      • SVGDocument

        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()).

        Parameters:
        address - The address.
      • SVGDocument

        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()).

        Parameters:
        url - The document URL.
      • SVGDocument

        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()).

        Parameters:
        address - The address.
        configuration - The configuration.
      • SVGDocument

        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()).

        Parameters:
        url - The document URL.
        configuration - The configuration.
      • SVGDocument

        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()).

        Parameters:
        content - The document content.
        baseUri - The base URI of the document.
        Throws:
        com.aspose.html.internal.ms.System.ArgumentNullException - baseUri is null.
      • SVGDocument

        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()).

        Parameters:
        content - The document content.
        baseUri - The base URI of the document.
        configuration - The configuration.
        Throws:
        com.aspose.html.internal.ms.System.ArgumentNullException - baseUri is null.
      • SVGDocument

        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()).

        Parameters:
        content - The document content.
        baseUri - The base URI of the document.
        Throws:
        com.aspose.html.internal.ms.System.ArgumentNullException - baseUri is null.
      • SVGDocument

        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()).

        Parameters:
        content - The document content.
        baseUri - The base URI of the document.
        configuration - The configuration.
        Throws:
        com.aspose.html.internal.ms.System.ArgumentNullException - baseUri is null.
      • SVGDocument

        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()).

        Parameters:
        request - The request.
      • SVGDocument

        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()).

        Parameters:
        request - The request.
        configuration - The configuration.
      • SVGDocument

        public SVGDocument(com.aspose.html.BrowsingContext context)

        Initializes a new instance of the HTMLDocument class.

        Parameters:
        context - The context.
    • Method Detail

      • getTitle

        @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>)

        Value: The title of a document.
      • getReferrer

        @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.
      • getDomain

        @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.
      • save

        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".

        Parameters:
        url - Local URL to output file.
        Throws:
        com.aspose.html.internal.ms.System.ArgumentException - Raised if the specified url is not a valid local file URL.
      • save

        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".

        Parameters:
        path - Local path to output file.
        Throws:
        com.aspose.html.internal.ms.System.ArgumentException - Raised if the specified path is not a valid local file path.
      • save

        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".

        Parameters:
        path - Local path to output file.
        saveFormat - Format in which document is saved.
        Throws:
        com.aspose.html.internal.ms.System.ArgumentException - Raised if the specified path is not a valid local file path.
      • save

        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".

        Parameters:
        path - Local path to output file.
        saveOptions - SVG save options.
        Throws:
        com.aspose.html.internal.ms.System.ArgumentException - Raised if the specified path is not a valid local file path.
      • save

        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".

        Parameters:
        url - Local URL to output file.
        saveFormat - Format in which document is saved.
        Throws:
        com.aspose.html.internal.ms.System.ArgumentException - Raised if the specified url is not a valid local file URL.
      • save

        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".

        Parameters:
        url - Local URL to output file.
        saveOptions - SVG save options.
        Throws:
        com.aspose.html.internal.ms.System.ArgumentException - Raised if the specified url is not a valid local file URL.
      • renderTo

        public void renderTo(IDevice device)

        This method is used to print the contents of the current document to the specified device.

        Overrides:
        renderTo in class Document
        Parameters:
        device - The user device.
      • getOverrideStyle

        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.

        Specified by:
        getOverrideStyle in interface IDocumentCSS
        Parameters:
        elt - The element whose style is to be modified. This parameter cannot be null.
        pseudoElt - The pseudo-element or null if none.
        Returns:
        The override style declaration