public interface

EmbeddedFile

com.pspdfkit.document.files.EmbeddedFile

Class Overview

Represents file embedded in FileAnnotation or PdfDocument.

Summary

Public Methods
abstract FileAnnotation getAnnotation()
Returns FileAnnotation to which this file is attached to.
abstract byte[] getFileData()
Reads whole file and returns its data.
abstract String getFileDescription()
Returns file description.
abstract String getFileName()
Returns name of the file.
abstract long getFileSize()
Returns file size.
abstract String getId()
Returns identifier of this embedded file.
abstract Date getModificationDate()
Returns file modification date.
abstract void writeToStream(OutputStream outputStream)
Writes the complete contents of this file to the specified output stream.
abstract Completable writeToStreamAsync(OutputStream outputStream)
Writes the complete contents of this file to the specified output stream, asynchronously.

Public Methods

public abstract FileAnnotation getAnnotation ()

Returns FileAnnotation to which this file is attached to.

Returns
  • Owning annotation or null if not available.

public abstract byte[] getFileData ()

Reads whole file and returns its data. This could take a while and should be executed on background thread.

Returns
  • Byte array of file's data.
Throws
IOException When operation fails.

public abstract String getFileDescription ()

Returns file description.

Returns
  • File description or null if not set.

public abstract String getFileName ()

Returns name of the file.

public abstract long getFileSize ()

Returns file size.

Returns

public abstract String getId ()

Returns identifier of this embedded file.

Returns
  • Identifier of this embedded file that is unique across the document.

public abstract Date getModificationDate ()

Returns file modification date.

Returns
  • File modification date or null if not set.

public abstract void writeToStream (OutputStream outputStream)

Writes the complete contents of this file to the specified output stream.

Parameters
outputStream Output stream to which to write file's data.
Throws
IOException When operation fails.

public abstract Completable writeToStreamAsync (OutputStream outputStream)

Writes the complete contents of this file to the specified output stream, asynchronously.

Parameters
outputStream Output stream to which to write file's data.
Returns
  • Completable that completes once the writing finishes.