Attachment
Leave feedback
On this page
Inheritance: java.lang.Object
public abstract class Attachment
Represents a file attached to a document.
Learn more
| Method | Description |
|---|---|
| getDocumentInfo() | Gets the information about a document stored in the attached file. |
| getContent() | Gets the attached file content. |
| setContent(byte[] value) | Sets the attached file content. |
| createWatermarker() | Loads a content from the attached file. |
| createWatermarker(LoadOptions loadOptions) | Loads a content from the attached file with the specified load options. |
| createWatermarker(LoadOptions loadOptions, WatermarkerSettings watermarkerSettings) | Loads a content from the attached file with the specified load options and settings. |
| getContentStream() | Gets a stream from the attached file. |
| setContentStream(System.IO.Stream stream) | Updates attached file from a stream. |
| updateContent(Watermarker updatedVersion) | Updates the attached content. |
public final IDocumentInfo getDocumentInfo()
Gets the information about a document stored in the attached file.
Returns:
IDocumentInfo - The [IDocumentInfo](../../com.groupdocs.watermark.common/idocumentinfo) instance that contains detected information.
public abstract byte[] getContent()
Gets the attached file content.
Returns: byte[] - The attached file content.
public abstract void setContent(byte[] value)
Sets the attached file content.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | byte[] | The attached file content. |
public final Watermarker createWatermarker()
Loads a content from the attached file.
Returns:
Watermarker - The instance of appropriate descendant of [Content](../../com.groupdocs.watermark.contents/content) class.
public final Watermarker createWatermarker(LoadOptions loadOptions)
Loads a content from the attached file with the specified load options.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| loadOptions | LoadOptions | Additional options to use when loading an attachment content. |
Returns:
Watermarker - The instance of appropriate descendant of [Content](../../com.groupdocs.watermark.contents/content) class.
public final Watermarker createWatermarker(LoadOptions loadOptions, WatermarkerSettings watermarkerSettings)
Loads a content from the attached file with the specified load options and settings.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| loadOptions | LoadOptions | Additional options to use when loading an attachment content. |
| watermarkerSettings | WatermarkerSettings | Additional settings to use when working with loaded document. |
Returns:
Watermarker - The instance of appropriate descendant of [Content](../../com.groupdocs.watermark.contents/content) class.
public System.IO.Stream getContentStream()
Gets a stream from the attached file.
Returns: com.aspose.ms.System.IO.Stream - The stream to read the file content from.
public void setContentStream(System.IO.Stream stream)
Updates attached file from a stream.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| stream | com.aspose.ms.System.IO.Stream | The stream to update attached file from. |
public final void updateContent(Watermarker updatedVersion)
Updates the attached content.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| updatedVersion | Watermarker | The updated version of the content. |
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.