Skip to content

Commit

Permalink
Update content 2024-03-04 06:27:48
Browse files Browse the repository at this point in the history
  • Loading branch information
yevgen-nykytenko committed Mar 4, 2024
1 parent 0deda95 commit 1abdc1f
Show file tree
Hide file tree
Showing 548 changed files with 14,161 additions and 13,043 deletions.
17 changes: 13 additions & 4 deletions english/nodejs-java/_index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
---
title: GroupDocs.Viewer for Node.js via Java
type: docs
weight: 11
url: /nodejs-java/
keywords: "GroupDocs.Viewer for Node.js via Java, GroupDocs Viewer, GroupDocs PDF, GroupDocs DOCX, GroupDocs API Reference."
description: "Streamline Cross-Platform Document and Image Viewing with Node.js using GroupDocs.Viewer APIs"
description: GroupDocs.Viewer for Node.js via Java API References contain examples, code snippets, and API documentation. It provides packages, classes, interfaces, and other API details.
is_root: true
---
## Namespace [groupdocs.viewer](groupdocs.viewer)

## Packages
| Package | Description |
| --- | --- |
| [com.groupdocs.viewer](./com.groupdocs.viewer) | The package provides classes for rendering documents in HTML5, Image, or PDF modes with fast and high-quality results. |
| [com.groupdocs.viewer.caching](./com.groupdocs.viewer.caching) | The package provides classes for customizing caching behavior. |
| [com.groupdocs.viewer.caching.extra](./com.groupdocs.viewer.caching.extra) | The package provides functionality for using custom models in cache implementation. |
| [com.groupdocs.viewer.fonts](./com.groupdocs.viewer.fonts) | The package provides classes and enumerations to manage fonts used during the rendering process. |
| [com.groupdocs.viewer.logging](./com.groupdocs.viewer.logging) | The package provides classes for configuring the logging system in GroupDocs.Viewer. |
| [com.groupdocs.viewer.options](./com.groupdocs.viewer.options) | The package provides classes to specify additional options when rendering documents. |
| [com.groupdocs.viewer.results](./com.groupdocs.viewer.results) | The package provides classes and interfaces that represent document rendering results. |
| [com.groupdocs.viewer.utils](./com.groupdocs.viewer.utils) | The package provides helper and utility classes for various functionalities. |
24 changes: 24 additions & 0 deletions english/nodejs-java/com.groupdocs.viewer.caching.extra/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: com.groupdocs.viewer.caching.extra
second_title: GroupDocs.Viewer for Node.js via Java API Reference
description: The package provides functionality for using custom models in cache implementation.
type: docs
weight: 12
url: /nodejs-java/com.groupdocs.viewer.caching.extra/
---

The package provides functionality for using custom models in cache implementation.

The main class in this package is [CacheableFactory](../../com.groupdocs.viewer.caching.extra/cacheablefactory), which helps in customizing the cache by providing additional functionality.

For more details on using custom models in cache implementation in GroupDocs.Viewer, please refer to the [GroupDocs.Viewer Documentation][].


[GroupDocs.Viewer Documentation]: https://docs.groupdocs.com/viewer/java/


## Classes

| Class | Description |
| --- | --- |
| [CacheableFactory](../com.groupdocs.viewer.caching.extra/cacheablefactory) | This class helps customize [Cache](../com.groupdocs.viewer.caching/cache). |

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions english/nodejs-java/com.groupdocs.viewer.caching/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: com.groupdocs.viewer.caching
second_title: GroupDocs.Viewer for Node.js via Java API Reference
description: The package provides classes for customizing caching behavior.
type: docs
weight: 11
url: /nodejs-java/com.groupdocs.viewer.caching/
---

The package provides classes for customizing caching behavior.

The main classes and interfaces in this package are:

* [CacheKeys](../../com.groupdocs.viewer.caching/cachekeys) - Provides methods to retrieve unique identifiers for the cache entry.
* [FileCache](../../com.groupdocs.viewer.caching/filecache) - Represents a local on-disk cache.

The [Cache](../../com.groupdocs.viewer.caching/cache) interface defines methods required for storing rendered documents and document resources in the cache.

For more details on customizing caching behavior in GroupDocs.Viewer, please refer to the [GroupDocs.Viewer Documentation][].


[GroupDocs.Viewer Documentation]: https://docs.groupdocs.com/viewer/java/


## Classes

| Class | Description |
| --- | --- |
| [CacheKeys](../com.groupdocs.viewer.caching/cachekeys) | Provides methods to retrieve the unique identifier for a cache entry. |
| [FileCache](../com.groupdocs.viewer.caching/filecache) | Represents a local on-disk cache. |

## Interfaces

| Interface | Description |
| --- | --- |
| [Cache](../com.groupdocs.viewer.caching/cache) | Defines methods required for storing rendered documents and document resources cache. |
92 changes: 92 additions & 0 deletions english/nodejs-java/com.groupdocs.viewer.caching/cache/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
title: Cache
second_title: GroupDocs.Viewer for Node.js via Java API Reference
description: Defines methods required for storing rendered documents and document resources cache.
type: docs
weight: 12
url: /nodejs-java/com.groupdocs.viewer.caching/cache/
---```
public interface Cache
```

Defines methods required for storing rendered documents and document resources cache.

The Cache interface defines the methods required for storing rendered documents and document resources cache in the GroupDocs.Viewer component. It provides a contract for implementing different cache mechanisms to enhance the performance of document rendering by caching frequently accessed data.

Example usage:

```
// Implement a custom cache by implementing the Cache interface
public class MyCustomCache implements Cache {
// Implement the methods of the Cache interface based on your caching mechanism
// ...
}
// Create an instance of your custom cache
Cache myCache = new MyCustomCache();
final ViewerSettings viewerSettings = new ViewerSettings();
// Set the custom cache to viewerSettings
viewerSettings.setCache(myCache);
// Use the viewerSettings object for creating Viewer object to render document with custom cache
try (Viewer viewer = new Viewer(documentPath, viewerSettings)) {
// Use the viewer object for document rendering
}
```

***Note:** The Cache interface allows you to implement custom cache mechanisms tailored to your specific requirements. GroupDocs.Viewer also provides built-in cache implementation such as [FileCache](../../com.groupdocs.viewer.caching/filecache).*
## Methods

| Method | Description |
| --- | --- |
| [set(String key, Object value)](#set-java.lang.String-java.lang.Object-) | Inserts a cache entry into the cache. |
| [<T>get(String key, Class<T> clazz)](#-T-get-java.lang.String-java.lang.Class-T--) | Retrieves the entry associated with the specified key if it is present, and returns null otherwise. |
| [getKeys(String filter)](#getKeys-java.lang.String-) | Returns all keys that match the specified filter. |
### set(String key, Object value) {#set-java.lang.String-java.lang.Object-}
```
public abstract void set(String key, Object value)
```


Inserts a cache entry into the cache.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| key | java.lang.String | A unique identifier for the cache entry. |
| value | java.lang.Object | The object to insert. |

### <T>get(String key, Class<T> clazz) {#-T-get-java.lang.String-java.lang.Class-T--}
```
public abstract T <T>get(String key, Class<T> clazz)
```


Retrieves the entry associated with the specified key if it is present, and returns null otherwise.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| key | java.lang.String | A key identifying the requested entry. |
| clazz | java.lang.Class<T> | The class type of the expected entry. |

**Returns:**
T - the entry associated with the key if found, or null otherwise.
### getKeys(String filter) {#getKeys-java.lang.String-}
```
public abstract List<String> getKeys(String filter)
```


Returns all keys that match the specified filter.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| filter | java.lang.String | The filter to use. |

**Returns:**
java.util.List<java.lang.String> - a list of keys that match the filter.
163 changes: 163 additions & 0 deletions english/nodejs-java/com.groupdocs.viewer.caching/cachekeys/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
---
title: CacheKeys
second_title: GroupDocs.Viewer for Node.js via Java API Reference
description: Provides methods to retrieve the unique identifier for a cache entry.
type: docs
weight: 10
url: /nodejs-java/com.groupdocs.viewer.caching/cachekeys/
---
**Inheritance:**
java.lang.Object
```
public class CacheKeys
```

Provides methods to retrieve the unique identifier for a cache entry.

The class allows you to generate cache keys based on different parameters, such as the document path, rendering options, and resource name. These cache keys can be used to store and retrieve cached data for efficient document rendering.

Example usage:

```
// Generate a cache key for a file
String fileKey = CacheKeys.getFileKey("filename.pdf");
// Generate a cache key for a page
String pageKey = CacheKeys.getPageKey(pageNumber, FileType.HTML.getExtension());
// Generate a cache key for a resource
Resource resource = new Resource("styles.css", false);
String pageKey = CacheKeys.getResourceKey(pageNumber, resource);
```
## Fields

| Field | Description |
| --- | --- |
| [PAGE_NUMBER](#PAGE-NUMBER) | |
## Methods

| Method | Description |
| --- | --- |
| [getAttachmentsKey()](#getAttachmentsKey--) | Returns the unique identifier for the cache entry that represents a collection of [Attachment](../../com.groupdocs.viewer.results/attachment) objects. |
| [getAttachmentKey(String attachmentId)](#getAttachmentKey-java.lang.String-) | Retrieves the unique identifier for the cache entry representing an attachment file. |
| [getViewInfoKey()](#getViewInfoKey--) | Retrieves the unique identifier for the cache entry that represents a [ViewInfo](../../com.groupdocs.viewer.results/viewinfo) object. |
| [getFileInfoKey()](#getFileInfoKey--) | Retrieves the unique identifier for the cache entry that represents a [ViewInfo](../../com.groupdocs.viewer.results/viewinfo) object. |
| [getFileKey(String extension)](#getFileKey-java.lang.String-) | Retrieves the unique identifier for the cache entry that represents a file. |
| [getPageKey(int pageNumber, String extension)](#getPageKey-int-java.lang.String-) | Retrieves the unique identifier for the cache entry that represents a page file. |
| [getResourceKey(int pageNumber, Resource resource)](#getResourceKey-int-com.groupdocs.viewer.results.Resource-) | Returns a unique identifier for the cache entry that represents a [Resource](../../com.groupdocs.viewer.results/resource) object. |
| [getResourceFilter(int pageNumber)](#getResourceFilter-int-) | Returns a filter string to search for cache entries that represent [Resource](../../com.groupdocs.viewer.results/resource) objects. |
### PAGE_NUMBER {#PAGE-NUMBER}
```
public static final String PAGE_NUMBER
```


### getAttachmentsKey() {#getAttachmentsKey--}
```
public static String getAttachmentsKey()
```


Returns the unique identifier for the cache entry that represents a collection of [Attachment](../../com.groupdocs.viewer.results/attachment) objects.

**Returns:**
java.lang.String - the unique identifier for the attachments cache entry.
### getAttachmentKey(String attachmentId) {#getAttachmentKey-java.lang.String-}
```
public static String getAttachmentKey(String attachmentId)
```


Retrieves the unique identifier for the cache entry representing an attachment file.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| attachmentId | java.lang.String | The unique identifier of the attachment (in the context of a single file). |

**Returns:**
java.lang.String - the unique identifier for the attachment file cache entry.
### getViewInfoKey() {#getViewInfoKey--}
```
public static String getViewInfoKey()
```


Retrieves the unique identifier for the cache entry that represents a [ViewInfo](../../com.groupdocs.viewer.results/viewinfo) object.

**Returns:**
java.lang.String - the unique identifier for the cache entry.
### getFileInfoKey() {#getFileInfoKey--}
```
public static String getFileInfoKey()
```


Retrieves the unique identifier for the cache entry that represents a [ViewInfo](../../com.groupdocs.viewer.results/viewinfo) object.

**Returns:**
java.lang.String - the unique identifier for the cache entry representing a [ViewInfo](../../com.groupdocs.viewer.results/viewinfo) object.
### getFileKey(String extension) {#getFileKey-java.lang.String-}
```
public static String getFileKey(String extension)
```


Retrieves the unique identifier for the cache entry that represents a file.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| extension | java.lang.String | The filename suffix (including the period ".") e.g. ".doc". |

**Returns:**
java.lang.String - the unique identifier for the cache entry representing a file.
### getPageKey(int pageNumber, String extension) {#getPageKey-int-java.lang.String-}
```
public static String getPageKey(int pageNumber, String extension)
```


Retrieves the unique identifier for the cache entry that represents a page file.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| pageNumber | int | The number of the page. |
| extension | java.lang.String | The filename suffix (including the period ".") e.g. ".doc". |

**Returns:**
java.lang.String - the unique identifier for the cache entry representing a page file.
### getResourceKey(int pageNumber, Resource resource) {#getResourceKey-int-com.groupdocs.viewer.results.Resource-}
```
public static String getResourceKey(int pageNumber, Resource resource)
```


Returns a unique identifier for the cache entry that represents a [Resource](../../com.groupdocs.viewer.results/resource) object.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| pageNumber | int | The number of the page. |
| resource | [Resource](../../com.groupdocs.viewer.results/resource) | The HTML resource. |

**Returns:**
java.lang.String - the unique identifier for the cache entry.
### getResourceFilter(int pageNumber) {#getResourceFilter-int-}
```
public static String getResourceFilter(int pageNumber)
```


Returns a filter string to search for cache entries that represent [Resource](../../com.groupdocs.viewer.results/resource) objects.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| pageNumber | int | The number of the page. |

**Returns:**
java.lang.String - the filter string to search for cache entries.
Loading

0 comments on commit 1abdc1f

Please sign in to comment.