Features: Document Processing | PSPDFKit for Android [PDF]

val outputFile = File(getFilesDir(), "extracted-pages.pdf") val task = PdfProcessorTask(document).keepPages(setOf(4, 5,

18 downloads 15 Views 448KB Size

Recommend Stories


[PDF] Gregg College Keyboarding Document Processing
Open your mouth only if what you are going to say is more beautiful than the silience. BUDDHA

PDF Gregg College Keyboading Document Processing (GDP)
Ask yourself: How much time do I spend dwelling on the past or worrying about the future? Next

desktop document processing & automation
Be who you needed when you were younger. Anonymous

pdf Android 6 for Programmers
And you? When will you begin that long journey into yourself? Rumi

PDF Kotlin for Android Developers
Those who bring sunshine to the lives of others cannot keep it from themselves. J. M. Barrie

Java Programming For Android For Dummies Pdf
Don't ruin a good today by thinking about a bad yesterday. Let it go. Anonymous

for Android
Be like the sun for grace and mercy. Be like the night to cover others' faults. Be like running water

Android Based Optical Character Recognition for Noisy Document Images
Goodbyes are only for those who love with their eyes. Because for those who love with heart and soul

PdF Download Kotlin for Android Developers
We must be willing to let go of the life we have planned, so as to have the life that is waiting for

Learn HTML5 and JavaScript for Android Pdf
We can't help everyone, but everyone can help someone. Ronald Reagan

Idea Transcript


PdfProcessor

PdfProcessor

1 2 3 4 5 6 7 8

// Pages numbers start at 0. This range therefore contains the 5th page of the document. val task = PdfProcessorTask(document).keepPages(setOf(4)) // Keep pages 5, 6 and 7. val task = PdfProcessorTask(document).keepPages(setOf(4, 5, 6)) // Remove first page val task = PdfProcessorTask(document).removePages(setOf(0))

PdfProcessorTask PdfProcessor#processDocumentAsync

PdfProcessor#processDocument

PdfProcessorTask

val outputFile = File(getFilesDir(), "extracted-pages.pdf") val task = PdfProcessorTask(document).keepPages(setOf(4, 5, 6)) 1 2 3 4 5 6 7 8 9

PdfProcessor.processDocumentAsync(task, outputFile) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe({ progress: PdfProcessor.ProcessorProgress -> Toast.makeText(context, "Processing page " + progress.pagesProcessed + "/" + progress.totalPages, Toast.LENGTH_SHORT) }, { error: Throwable -> Toast.makeText(context, "Processing has failed:" + error.message, Toast.LENGTH_SHORT) }, { Toast.makeText(context, "Processing has been completed successfully.", Toast.LENGTH_SHORT); });

PdfDocument PSPDFKit#openDocuments

PdfActivity#showDocuments

DocumentProcessingExample

PdfProcessorTask#changeAllAnnotations PdfProcessorTask#changeAnnotationsOfType

PdfProcessorTask#changeAnnotations

// Process all pages of the document, flattening all of its annotations. val task = 1

PdfProcessorTask(document).changeAllAnnotations(PdfProcessorTask.AnnotationProcessingMode.FLATTEN)

2

PdfProcessor.processDocumentAsync(...) ...

3 4

// Flatten only free text annotations, copy everything else.

5

val task =

6

PdfProcessorTask(document).changeAllAnnotations(PdfProcessorTask.AnnotationProcessingMode.KEEP)

7

.changeAnnotationsOfType(AnnotationType.FREETEXT,

8

PdfProcessorTask.AnnotationProcessingMode.FLATTEN) PdfProcessor.processDocumentAsync(...) ...

AnnotationType::WIDGET

FormType PdfProcessorTask#changeFormsOfType

1

// Rotate all pages of the document by 90°.

2

val task = PdfProcessorTask(document)

3

for(pageIndex in 0..document.pageCount-1) {

4

task.rotatePage(pageIndex, 90)

5

}

6 7

PdfProcessor.processDocumentAsync(...) ...

PdfProcessor DocumentSaveOptions#setPassword

1

val task = PdfProcessorTask(document)

2 3

// Create default document save options.

4

var documentSaveOptions = document.getDefaultDocumentSaveOptions()

5

// This will create encrypted password protected document.

6

documentSaveOptions.password = "password"

7 8

// Use created save options when processing the document.

9

PdfProcessor.processDocumentAsync(task, outputFile, documentSaveOptions) ...

Smile Life

When life gives you a hundred reasons to cry, show life that you have a thousand reasons to smile

Get in touch

© Copyright 2015 - 2024 PDFFOX.COM - All rights reserved.