Class PdfProcessor
-
- All Implemented Interfaces:
public final class PdfProcessor
Copy, merge or modify PDF documents. It also allows flattening and filtering of annotation data.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
PdfProcessor.ProcessorProgress
Object representing processing progress. Sent while processing in async PdfProcessor methods.
-
Method Summary
Modifier and Type Method Description static Flowable<PdfProcessor.ProcessorProgress>
processDocumentAsync(@NonNull() PdfProcessorTask task, @NonNull() File outputFile)
Starts the document processing, using the default DocumentSaveOptions for the processed document. static Flowable<PdfProcessor.ProcessorProgress>
processDocumentAsync(@NonNull() PdfProcessorTask task, @NonNull() File outputFile, @NonNull() DocumentSaveOptions saveOptions)
Starts the document processing. static Flowable<PdfProcessor.ProcessorProgress>
processDocumentAsync(@NonNull() PdfProcessorTask task, @NonNull() OutputStream outputStream)
Starts the document processing, using the default DocumentSaveOptions for the processed document. static Flowable<PdfProcessor.ProcessorProgress>
processDocumentAsync(@NonNull() PdfProcessorTask task, @NonNull() OutputStream outputStream, @NonNull() DocumentSaveOptions saveOptions)
Starts the document processing. static void
processDocument(@NonNull() PdfProcessorTask task, @NonNull() File outputFile)
Starts the document processing on current thread. static void
processDocument(@NonNull() PdfProcessorTask task, @NonNull() File outputFile, @NonNull() DocumentSaveOptions saveOptions)
Starts the document processing on current thread. -
-
Method Detail
-
processDocumentAsync
@NonNull() static Flowable<PdfProcessor.ProcessorProgress> processDocumentAsync(@NonNull() PdfProcessorTask task, @NonNull() File outputFile)
Starts the document processing, using the default DocumentSaveOptions for the processed document.
NOTE: Returned observable doesn't have target thread set so use subscribeOn to choose the thread to run processing on.
- Parameters:
task
- Defined processing task.outputFile
- Output PDF file to be written.- Returns:
Observable which will periodically emit progress objects until processing is complete.
-
processDocumentAsync
@NonNull() static Flowable<PdfProcessor.ProcessorProgress> processDocumentAsync(@NonNull() PdfProcessorTask task, @NonNull() File outputFile, @NonNull() DocumentSaveOptions saveOptions)
Starts the document processing.
NOTE: Returned observable doesn't have target thread set so use subscribeOn to choose the thread to run processing on.
- Parameters:
task
- Defined processing task.outputFile
- Output PDF file to be written.saveOptions
- Save options defining password protection, permissions, etc.- Returns:
Observable which will periodically emit progress objects until processing is complete.
-
processDocumentAsync
@NonNull() static Flowable<PdfProcessor.ProcessorProgress> processDocumentAsync(@NonNull() PdfProcessorTask task, @NonNull() OutputStream outputStream)
Starts the document processing, using the default DocumentSaveOptions for the processed document.
NOTE: This does not work with stripEmptyPages as it needs to reopen processed document which is not possible with OutputStream.
NOTE: Returned observable doesn't have target thread set so use subscribeOn to choose the thread to run processing on.
- Parameters:
task
- Defined processing task.outputStream
- Output stream for writing output PDF data.- Returns:
Observable which will periodically emit progress objects until processing is complete.
-
processDocumentAsync
@NonNull() static Flowable<PdfProcessor.ProcessorProgress> processDocumentAsync(@NonNull() PdfProcessorTask task, @NonNull() OutputStream outputStream, @NonNull() DocumentSaveOptions saveOptions)
Starts the document processing.
NOTE: This does not work with stripEmptyPages as it needs to reopen processed document which is not possible with OutputStream.
NOTE: Returned observable doesn't have target thread set so use subscribeOn to choose the thread to run processing on.
- Parameters:
task
- Defined processing task.outputStream
- Output stream for writing output PDF data.saveOptions
- Save options defining password protection, permissions, etc.- Returns:
Observable which will periodically emit progress objects until processing is complete.
-
processDocument
static void processDocument(@NonNull() PdfProcessorTask task, @NonNull() File outputFile)
Starts the document processing on current thread. This will use the default for the processed document.
NOTE: Document processing can take time do not run it on main thread.
- Parameters:
task
- Defined processing task.outputFile
- Output PDF file to be written.
-
processDocument
static void processDocument(@NonNull() PdfProcessorTask task, @NonNull() File outputFile, @NonNull() DocumentSaveOptions saveOptions)
Starts the document processing on current thread.
NOTE: Document processing can take time do not run it on main thread.
- Parameters:
task
- Defined processing task.outputFile
- Output PDF file to be written.saveOptions
- Save options defining password protection, permissions, etc.
-
-
-
-