View Javadoc
1   package com.acumenvelocity.ath.model;
2   
3   /**
4    * OCR (Optical Character Recognition) mode for PDF conversion: * `AUTO` - Automatically
5    * detect if OCR is needed by analyzing the PDF content. If the PDF contains less than 10 visible
6    * characters in the first 5 pages, OCR will be enabled. This is the default mode. *
7    * `ENABLED` - Always perform OCR regardless of PDF content. Use this for scanned
8    * documents or image-based PDFs. * `DISABLED` - Never perform OCR. Use this for PDFs with
9    * selectable text to speed up conversion.
10   **/
11  import com.fasterxml.jackson.annotation.JsonCreator;
12  import com.fasterxml.jackson.annotation.JsonValue;
13  
14  /**
15   * OCR (Optical Character Recognition) mode for PDF conversion: * `AUTO` - Automatically detect if
16   * OCR is needed by analyzing the PDF content. If the PDF contains less than 10 visible characters
17   * in the first 5 pages, OCR will be enabled. This is the default mode. * `ENABLED` - Always perform
18   * OCR regardless of PDF content. Use this for scanned documents or image-based PDFs. * `DISABLED` -
19   * Never perform OCR. Use this for PDFs with selectable text to speed up conversion.
20   */
21  public enum OcrMode {
22  
23    AUTO("AUTO"),
24  
25    ENABLED("ENABLED"),
26  
27    DISABLED("DISABLED");
28  
29    private String value;
30  
31    OcrMode(String value) {
32      this.value = value;
33    }
34  
35    @Override
36    @JsonValue
37    public String toString() {
38      return String.valueOf(value);
39    }
40  
41    @JsonCreator
42    public static OcrMode fromValue(String text) {
43      for (OcrMode b : OcrMode.values()) {
44        if (String.valueOf(b.value).equals(text)) {
45          return b;
46        }
47      }
48      throw new IllegalArgumentException("Unexpected value '" + text + "'");
49    }
50  }