public class

DocumentSharingProviderProcessor

extends Object
java.lang.Object
   ↳ com.pspdfkit.document.sharing.DocumentSharingProviderProcessor

Class Overview

Prepares data in DocumentSharingProvider for sharing via Android's share framework.

Summary

Nested Classes
interface DocumentSharingProviderProcessor.PdfProcessorProgressListener Listener for PdfProcessor progress updates used when preparing PdfDocument for sharing. 
Public Constructors
DocumentSharingProviderProcessor()
Public Methods
static Single<Uri> prepareBitmapForSharing(Context context, Bitmap bitmap)
Writes bitmap to directory backed by DocumentSharingProvider.
static Single<Uri> prepareBitmapForSharing(Context context, Bitmap bitmap, Bitmap.CompressFormat compressFormat, int compressQuality, String fileName)
Writes bitmap to directory backed by DocumentSharingProvider.
static Single<Uri> prepareDocumentForSharing(Context context, PdfDocument document, PdfProcessorTask processorTask, String documentName)
Prepares document for sharing via Android share framework.
static Single<Uri> prepareDocumentForSharing(Context context, PdfDocument document, String documentName)
Prepares document for sharing via Android share framework.
static Single<Uri> prepareDocumentForSharing(Context context, PdfDocument document, PdfProcessorTask processorTask, String documentName, DocumentSharingProviderProcessor.PdfProcessorProgressListener progressListener)
Prepares document for sharing via Android share framework.
static Single<Uri> prepareEmbeddedFileForSharing(Context context, EmbeddedFile embeddedFile)
Extracts embedded file to directory backed by DocumentSharingProvider.
static Single<Uri> prepareFileForSharing(Context context, DataProvider fileDataProvider, String fileName)
Writes file to directory backed by DocumentSharingProvider.
static Single<Uri> prepareSoundAnnotationForSharing(Context context, SoundAnnotation soundAnnotation)
Extracts audio data embedded in a SoundAnnotation to a directory backed by DocumentSharingProvider.
static Single<Uri> prepareSoundAnnotationForSharing(Context context, SoundAnnotation soundAnnotation, String fileName)
Extracts audio data embedded in a SoundAnnotation to a directory backed by DocumentSharingProvider.
static boolean soundAnnotationSupportsSharing(SoundAnnotation soundAnnotation)
Checks whether sound annotation can be shared: is attached to document and has audio data in supported format (i.e.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public DocumentSharingProviderProcessor ()

Public Methods

public static Single<Uri> prepareBitmapForSharing (Context context, Bitmap bitmap)

Writes bitmap to directory backed by DocumentSharingProvider.

Scheduler:
Method does not operate by default on a particular Scheduler.

Parameters
context Context to use.
bitmap Bitmap that should be compressed and saved into file.
Returns
  • Single emitting Uri that can be used for sharing the bitmap file to other apps or an error if the bitmap could not be exported.

public static Single<Uri> prepareBitmapForSharing (Context context, Bitmap bitmap, Bitmap.CompressFormat compressFormat, int compressQuality, String fileName)

Writes bitmap to directory backed by DocumentSharingProvider.

Scheduler:
Method does not operate by default on a particular Scheduler.

Parameters
context Context to use.
bitmap Bitmap that should be compressed and saved into file.
compressFormat The format of the compressed image.
compressQuality The quality that compressor should use. Must be [0,100]. 0 means compress for small size, 100 means compress for max quality. Some lossless formats (for example PNG), ignore the quality setting.
fileName Optional file name used for sharing (this is the shared file name as seen by other apps).
Returns
  • Single emitting Uri that can be used for sharing the bitmap file to other apps or an error if the bitmap could not be exported.

public static Single<Uri> prepareDocumentForSharing (Context context, PdfDocument document, PdfProcessorTask processorTask, String documentName)

Prepares document for sharing via Android share framework.

Scheduler:
Method does not operate by default on a particular Scheduler.

Parameters
document Document we are going to share.
processorTask Task to use for processing the document before sharing.
documentName Optional document name used for sharing (this is the shared document file name as seen by other apps).
Returns
  • Single emitting Uri that can be used for sharing the document to other apps or an error if the document could not be exported for sharing.

public static Single<Uri> prepareDocumentForSharing (Context context, PdfDocument document, String documentName)

Prepares document for sharing via Android share framework.

Scheduler:
Method does not operate by default on a particular Scheduler.

Parameters
document Document that should be shared.
documentName Optional document name used for sharing (this is the shared document file name as seen by other apps).
Returns
  • Single emitting Uri that can be used for sharing the document to other apps or an error if the document could not be exported for sharing.

public static Single<Uri> prepareDocumentForSharing (Context context, PdfDocument document, PdfProcessorTask processorTask, String documentName, DocumentSharingProviderProcessor.PdfProcessorProgressListener progressListener)

Prepares document for sharing via Android share framework.

Scheduler:
Method does not operate by default on a particular Scheduler.

Parameters
document Document that should be shared.
processorTask Task to use for processing the document before sharing.
documentName Optional document name used for sharing (this is the shared document file name as seen by other apps).
progressListener Optional listener for PdfProcessor progress.
Returns
  • Single emitting Uri that can be used for sharing the document to other apps or an error if the document could not be exported for sharing.

public static Single<Uri> prepareEmbeddedFileForSharing (Context context, EmbeddedFile embeddedFile)

Extracts embedded file to directory backed by DocumentSharingProvider.

Scheduler:
Method does not operate by default on a particular Scheduler.

Parameters
embeddedFile Embedded file we want to extract.
Returns
  • Single emitting Uri that can be used for sharing the embedded file to other apps or an error if the file could not be exported.

public static Single<Uri> prepareFileForSharing (Context context, DataProvider fileDataProvider, String fileName)

Writes file to directory backed by DocumentSharingProvider.

Scheduler:
Method does not operate by default on a particular Scheduler.

Parameters
context Context to use.
fileDataProvider Data provider with file data.
fileName Optional file name used for sharing (this is the shared file name as seen by other apps).
Returns
  • Single emitting Uri that can be used for sharing the file to other apps or an error if the file could not be exported.

public static Single<Uri> prepareSoundAnnotationForSharing (Context context, SoundAnnotation soundAnnotation)

Extracts audio data embedded in a SoundAnnotation to a directory backed by DocumentSharingProvider. Audio data is written as a WAV file.

Scheduler:
Method does not operate by default on a particular Scheduler.

Parameters
soundAnnotation Sound annotation that should be shared.
Returns
  • Single emitting Uri that can be used for sharing the sound annotation to other apps or an error if the audio data could not be exported.

public static Single<Uri> prepareSoundAnnotationForSharing (Context context, SoundAnnotation soundAnnotation, String fileName)

Extracts audio data embedded in a SoundAnnotation to a directory backed by DocumentSharingProvider. Audio data is written as a WAV file.

Scheduler:
Method does not operate by default on a particular Scheduler.

Parameters
soundAnnotation Sound annotation that should be shared.
fileName Optional file name used for sharing the wave file (this is the shared file name as seen by other apps).
Returns
  • Single emitting Uri that can be used for sharing the sound annotation to other apps or an error if the audio data could not be exported.

public static boolean soundAnnotationSupportsSharing (SoundAnnotation soundAnnotation)

Checks whether sound annotation can be shared: is attached to document and has audio data in supported format (i.e. with encoding SIGNED).

Parameters
soundAnnotation Sound annotation that should be shared.
Returns
  • True when sound annotation has audio data that can be shared.