public static class

OcrProcessor.Builder

extends Object
java.lang.Object
   ↳ com.pspdfkit.api.ocr.OcrProcessor.Builder

Class Overview

A builder for creating OcrProcessor instances.

Summary

Public Constructors
Builder(PdfDocument sourceDocument)
Create the builder to help construct an OcrProcessor.
Public Methods
OcrProcessor build()
Construct the OcrProcessor with the parameters given to this builder.
Builder setLanguage(OcrLanguage language)
Sets the OCR language.
Builder setPages(Set<Integer> pages)
Sets the pages for OCR.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Builder (PdfDocument sourceDocument)

Create the builder to help construct an OcrProcessor.

Parameters
sourceDocument The source document on which to perform OCR containing the image with recognizable text.

Public Methods

public OcrProcessor build ()

Construct the OcrProcessor with the parameters given to this builder.

Returns

public Builder setLanguage (OcrLanguage language)

Sets the OCR language. If this method is not called, the language will default to English.

Parameters
language The OcrLanguage with which to perform OCR.

public Builder setPages (Set<Integer> pages)

Sets the pages for OCR. If this method is not called, OCR will be performed on all pages.

Parameters
pages The page indices of the source document on which to perform OCR. Defaults to all pages if empty.