Class SharingOptions
-
- All Implemented Interfaces:
public class SharingOptions
Options for document processing during the sharing process.
-
-
Field Summary
Fields Modifier and Type Field Description public final PdfProcessorTask.AnnotationProcessingMode
annotationProcessingMode
public final String
documentName
-
Constructor Summary
Constructors Constructor Description SharingOptions(PdfProcessorTask.AnnotationProcessingMode annotationProcessingMode)
Constructs options for sharing document with all pages and default document name. SharingOptions(PdfProcessorTask.AnnotationProcessingMode annotationProcessingMode, List<Range> pages)
Constructs options for sharing document with default document name. SharingOptions(String documentName)
Constructs options for sharing document with all annotations and pages. SharingOptions(PdfProcessorTask.AnnotationProcessingMode annotationProcessingMode, List<Range> pages, String documentName)
Constructs options for sharing document.
-
Method Summary
Modifier and Type Method Description PdfProcessorTask.AnnotationProcessingMode
getAnnotationProcessingMode()
Returns annotation processing mode that describes what user wants to do with shared document annotations. String
getDocumentName()
Returns name of the document that should be used while sharing. static List<Range>
parsePageRange(@NonNull() String rangeString, @IntRange(from = 0) int documentPagesCount)
Parse page ranges strings. Set<Integer>
getPagesToRemove(@IntRange(from = 0) int documentPagesCount)
Retrieve set of pages that need to be removed by PdfProcessor before sharing. PdfProcessorTask
getProcessorTask(@NonNull() PdfDocument document)
Converts sharing options to PdfProcessorTask usable for processing document via PdfProcessor. int
hashCode()
boolean
equals(Object obj)
String
toString()
-
-
Constructor Detail
-
SharingOptions
SharingOptions(PdfProcessorTask.AnnotationProcessingMode annotationProcessingMode)
Constructs options for sharing document with all pages and default document name.- Parameters:
annotationProcessingMode
- Describes how annotations will be processed by before sharing.
-
SharingOptions
SharingOptions(PdfProcessorTask.AnnotationProcessingMode annotationProcessingMode, List<Range> pages)
Constructs options for sharing document with default document name.- Parameters:
annotationProcessingMode
- Describes how annotations will be processed by before sharing.pages
- Range of pages for sharing.
-
SharingOptions
SharingOptions(String documentName)
Constructs options for sharing document with all annotations and pages.- Parameters:
documentName
- Name of the document that will be sued while sharing.
-
SharingOptions
SharingOptions(PdfProcessorTask.AnnotationProcessingMode annotationProcessingMode, List<Range> pages, String documentName)
Constructs options for sharing document.- Parameters:
annotationProcessingMode
- Describes how annotations will be processed by before sharing.pages
- Range of pages for sharing.documentName
- Name of the document that will be sued while sharing.
-
-
Method Detail
-
getAnnotationProcessingMode
@NonNull() PdfProcessorTask.AnnotationProcessingMode getAnnotationProcessingMode()
Returns annotation processing mode that describes what user wants to do with shared document annotations.
- Returns:
An annotation processing mode to be applied to this document share process.
-
getDocumentName
@NonNull() String getDocumentName()
Returns name of the document that should be used while sharing.
- Returns:
A document name to be used on document in the sharing process.
-
parsePageRange
@NonNull() static List<Range> parsePageRange(@NonNull() String rangeString, @IntRange(from = 0) int documentPagesCount)
Parse page ranges strings.
- Parameters:
rangeString
- String with page range specification (e.g "1-5,8,11-13").documentPagesCount
- Number of pages in the document.- Returns:
List of parsed page ranges. If input range is invalid returns empty list.
-
getPagesToRemove
@NonNull() Set<Integer> getPagesToRemove(@IntRange(from = 0) int documentPagesCount)
Retrieve set of pages that need to be removed by PdfProcessor before sharing.
- Parameters:
documentPagesCount
- Number of pages in the document.- Returns:
Set of all pages that need to be removed.
-
getProcessorTask
@Nullable() PdfProcessorTask getProcessorTask(@NonNull() PdfDocument document)
Converts sharing options to PdfProcessorTask usable for processing document via PdfProcessor.
- Parameters:
document
- Document on which to run processing.- Returns:
Processing task if processing is necessary or
null
if no processing is required.
-
hashCode
int hashCode()
-
-
-
-