public class Resource extends Object implements Serializable
The Resource class represents a resource used in HTML rendering in the GroupDocs.Viewer component. It can represent various types of resources, such as fonts, styles, images, or graphics, that are included or referenced in the generated HTML output during the rendering process.
Example usage:
{@code
final HtmlViewOptions htmlViewOptions = HtmlViewOptions.forExternalResources(pageNumber -> , new ReleaseResourceStream() {Viewer,
HtmlViewOptions,
ReleaseResourceStream,
Serialized Form| Constructor and Description |
|---|
Resource(String fileName,
boolean nested)
Creates a new instance of the
Resource class. |
| Modifier and Type | Method and Description |
|---|---|
String |
getFileName()
Returns the file name of the resource.
|
boolean |
isNested()
Returns whether the resource resides inside another resource, e.g. a font resource that resides in a CSS or SVG resource.
|
void |
setFileName(String fileName)
Sets the file name of the resource.
|
void |
setNested(boolean nested)
Sets whether the resource resides inside another resource.
|
String |
toString()
Returns a string that represents the current object.
|
public Resource(String fileName, boolean nested)
Creates a new instance of the Resource class.
fileName - The resource file name.nested - Indicates whether the resource resides inside another resource, e.g., a font resource that resides in a CSS or SVG resource.IllegalArgumentException - Thrown when the fileName is null or empty.public final String getFileName()
Returns the file name of the resource.
public final boolean isNested()
Returns whether the resource resides inside another resource, e.g. a font resource that resides in a CSS or SVG resource.
public void setFileName(String fileName)
fileName - The new file name for the resource.public void setNested(boolean nested)
nested - Whether the resource should be set as nested.Copyright © 2024. All rights reserved.