ViewerSettings
Leave feedback
On this page
Inheritance: java.lang.Object
public class ViewerSettings
Defines settings for customizing the behavior of the Viewer component.
The ViewerSettings class provides options and properties to customize the behavior of the GroupDocs.Viewer component during the document rendering process. You can use this class to specify various settings, such as logger, custom cache implementation, and more.
Example usage:
final ViewerSettings viewerSettings = new ViewerSettings();
viewerSettings.setLogger(new ConsoleLogger(false, true));
try (Viewer viewer = new Viewer("source.pdf", viewerSettings)) {
// Document processing
}
| Constructor | Description |
|---|---|
| ViewerSettings(Cache cache, ILogger logger) | Initializes a new instance of the ViewerSettings class. |
| ViewerSettings(ILogger logger) | Initializes a new instance of the ViewerSettings class. |
| ViewerSettings(Cache cache) | Initializes a new instance of the ViewerSettings class. |
| ViewerSettings() | Initializes a new instance of the ViewerSettings class. |
| Method | Description |
|---|---|
| getLogger() | Gets the logger implementation used for logging (Errors, Warnings, Traces). |
| setLogger(ILogger logger) | Sets the logger implementation used for logging (Errors, Warnings, Traces). |
| getCache() | Gets the cache implementation used for storing rendering results. |
| setCache(Cache cache) | Sets the cache implementation used for storing rendering results. |
public ViewerSettings(Cache cache, ILogger logger)
Initializes a new instance of the ViewerSettings class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| cache | Cache | The cache. |
| logger | com.groupdocs.foundation.logging.ILogger | The logger. |
public ViewerSettings(ILogger logger)
Initializes a new instance of the ViewerSettings class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| logger | com.groupdocs.foundation.logging.ILogger | The logger. |
public ViewerSettings(Cache cache)
Initializes a new instance of the ViewerSettings class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| cache | Cache | The cache. |
public ViewerSettings()
Initializes a new instance of the ViewerSettings class.
public ILogger getLogger()
Gets the logger implementation used for logging (Errors, Warnings, Traces).
Returns: com.groupdocs.foundation.logging.ILogger - the logger implementation.
public void setLogger(ILogger logger)
Sets the logger implementation used for logging (Errors, Warnings, Traces).
Parameters:
| Parameter | Type | Description |
|---|---|---|
| logger | com.groupdocs.foundation.logging.ILogger | The logger implementation to set. |
public final Cache getCache()
Gets the cache implementation used for storing rendering results.
Returns: Cache - the cache implementation.
public void setCache(Cache cache)
Sets the cache implementation used for storing rendering results.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| cache | Cache | The cache implementation. |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.