public final class InputHtmlDocument extends Object implements IAuxDisposable
Encapsulates one HTML document, which is obtained from Document->HTML conversion and contains HTML markup and all related resources like CSS, images and fonts.
Modifier and Type | Field and Description |
---|---|
com.groupdocs.editor.events.ProcessEvents<com.groupdocs.editor.events.ProcessEventHandler> |
Disposed
Event, which occurs when this HTML document is disposed, right after finishing the disposing process
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes this HTML document instance, disposing its content and making its methods and properties non-working
|
String |
getBodyContent()
Returns a body of the HTML document (content between opening and closing BODY tags without these tags) as a string.
|
String |
getBodyContent(String externalResourcePrefix)
Returns a body of the HTML document (content between opening and closing BODY tags without these tags) as a string,
where links to the external resources contain specified prefix.
|
String |
getContent()
Returns overall content of the HTML document as a string.
|
String |
getContent(String externalResourcePrefix)
Returns overall content of the HTML document as a string, where links to the external resources contain specified prefix.
|
List<CssText> |
getCss()
Returns a list of CSS resources
|
List<String> |
getCssContent()
Returns content of all external stylesheets as a list of strings, where one string represents one stylesheet.
|
List<String> |
getCssContent(String externalResourcePrefix)
Returns content of all external stylesheets as a list of strings, where one string represents one stylesheet.
|
String |
getEmbeddedHtml()
Returns all content of this HTML document with all related resources in a form of a single string, where all resources are embedded inside the
HTML markup in a base64-encoded form.
|
List<FontResourceBase> |
getFontResources()
Allows to obtain or specify external font resources, which are used by this HTML document
|
List<IImageResource> |
getImageResources()
Allows to obtain or specify external image resources (raster images), which are used by this HTML document
|
boolean |
isDisposed()
Determines whether this HTML document is already disposed or not
|
void |
save(String htmlFilePath)
Saves this HTML document to the file on specified path, where HTML markup will be stored, and to the accompanying folder with resources.
|
void |
save(String htmlFilePath,
boolean saveStylesheets)
Saves this HTML document to the file on specified path, where HTML markup will be stored, and to the accompanying folder with resources.
|
void |
save(String htmlFilePath,
String resourcesFolderPath)
Saves this HTML document to the file on specified path, where HTML markup will be stored, and to the accompanying folder with resources,
which is located on specified path.
|
void |
save(String htmlFilePath,
String resourcesFolderPath,
boolean saveStylesheets)
Saves this HTML document to the file on specified path, where HTML markup will be stored, and to the accompanying folder with resources,
which is located on specified path.
|
public final com.groupdocs.editor.events.ProcessEvents<com.groupdocs.editor.events.ProcessEventHandler> Disposed
Event, which occurs when this HTML document is disposed, right after finishing the disposing process
public void dispose()
Disposes this HTML document instance, disposing its content and making its methods and properties non-working
dispose
in interface com.aspose.ms.System.IDisposable
public String getBodyContent()
Returns a body of the HTML document (content between opening and closing BODY tags without these tags) as a string.
public String getBodyContent(String externalResourcePrefix)
Returns a body of the HTML document (content between opening and closing BODY tags without these tags) as a string, where links to the external resources contain specified prefix.
externalResourcePrefix
- Through this parameter used can specify a prefix, which will be added to the links
to all external resources (images, fonts, CSS), which will be present in the resultant HTML string. If NULL or empty, prefixes will not be added.
public String getContent()
Returns overall content of the HTML document as a string.
public String getContent(String externalResourcePrefix)
Returns overall content of the HTML document as a string, where links to the external resources contain specified prefix.
externalResourcePrefix
- Through this parameter used can specify a prefix, which will be added to the links
to all external resources (images, fonts, CSS), which will be present in the resultant HTML string. If NULL or empty, prefixes will not be added.public List<String> getCssContent()
Returns content of all external stylesheets as a list of strings, where one string represents one stylesheet. Returns empty list, if there is no CSS for this document.
public List<String> getCssContent(String externalResourcePrefix)
Returns content of all external stylesheets as a list of strings, where one string represents one stylesheet. Specified prefix will be applied to every link to the external resource in every resultant stylesheet. Returns empty list, if there is no CSS for this document.
externalResourcePrefix
- Through this parameter used can specify a prefix, which will be added to the links
to all external resources (images and fonts), which will be present in the resultant CSS strings. If NULL or empty, prefixes will not be added.public String getEmbeddedHtml()
Returns all content of this HTML document with all related resources in a form of a single string, where all resources are embedded inside the HTML markup in a base64-encoded form.
public List<FontResourceBase> getFontResources()
Allows to obtain or specify external font resources, which are used by this HTML document
public List<IImageResource> getImageResources()
Allows to obtain or specify external image resources (raster images), which are used by this HTML document
public boolean isDisposed()
Determines whether this HTML document is already disposed or not
isDisposed
in interface IAuxDisposable
public void save(String htmlFilePath)
Saves this HTML document to the file on specified path, where HTML markup will be stored, and to the accompanying folder with resources. It is allowed to disable saving of stylesheets.
htmlFilePath
- Full path to the file, where HTML markup will be stored. File will be created or overwritten, if exists.
Accompanying resource folder will be created in the same folder, where HTML file exist.public void save(String htmlFilePath, boolean saveStylesheets)
Saves this HTML document to the file on specified path, where HTML markup will be stored, and to the accompanying folder with resources. It is allowed to disable saving of stylesheets.
htmlFilePath
- Full path to the file, where HTML markup will be stored. File will be created or overwritten, if exists.
Accompanying resource folder will be created in the same folder, where HTML file exist.saveStylesheets
- Boolean flag, which determines whether it is required to save all external stylesheets to files or notpublic void save(String htmlFilePath, String resourcesFolderPath)
Saves this HTML document to the file on specified path, where HTML markup will be stored, and to the accompanying folder with resources, which is located on specified path.
htmlFilePath
- Full path to the file, where HTML markup will be stored. Cannot be NULL or empty.
File will be created or overwritten, if exists.resourcesFolderPath
- Full path to the accompanying folder, where all related resources will be stored. Cannot be NULL or empty.
Folder will be created, if not exists.public void save(String htmlFilePath, String resourcesFolderPath, boolean saveStylesheets)
Saves this HTML document to the file on specified path, where HTML markup will be stored, and to the accompanying folder with resources, which is located on specified path. It is allowed to disable saving of stylesheets.
htmlFilePath
- Full path to the file, where HTML markup will be stored. Cannot be NULL or empty.
File will be created or overwritten, if exists.resourcesFolderPath
- Full path to the accompanying folder, where all related resources will be stored. Cannot be NULL or empty.
Folder will be created, if not exists.saveStylesheets
- Boolean flag, which determines whether it is required to save all external stylesheets to files or notCopyright © 2018. All rights reserved.