# Adding OCR capability

OCR components must be installed on the same server as TS file indexing service.

Only GhostScript and Terrasect are required to proces PDF files.

TEMPORARY FIX: &lt;tomcat&gt;\\catalina\\catalina.properties add java.io.tmpdir=c:/Temp

### <span class="mw-headline" id="bkmrk-install%3A-imagemagick-1">Install: ImageMagick binaries</span>

Download and unpack "portable" version (recommended c:\\ImageMagick)

```
  <a class="external free" href="https://www.imagemagick.org/script/binary-releases.php" rel="nofollow">https://www.imagemagick.org/script/binary-releases.php</a>
```

Register the location of the **convert** executeable in web.xml

```
   <context-param>
       <param-name>ExecutableImageMagick</param-name>
       <param-value>c:\ImageMagick\convert</param-value>
   </context-param>
```

Leaving the entry empty will prevent OCR handling of image files: png, jpg, jpeg

### <span class="mw-headline" id="bkmrk-install%3A-ghostscript-1">Install: Ghostscript binaries</span>

Download and run installer

```
  <a class="external free" href="http://www.ghostscript.com/download/gsdnld.html" rel="nofollow">http://www.ghostscript.com/download/gsdnld.html</a>
```

Note: You are not required to buy a license

Register the location of the **gswin64c** executeable in web.xml

```
   <context-param>
       <param-name>ExecutableGhostscript</param-name>
       <param-value>c:\Program Files\gs\gs9.20\bin\gswin64c.exe</param-value>
   </context-param>
```

Leaving the entry empty will prevent OCR handling of PDF files

### <span class="mw-headline" id="bkmrk-install%3A-tesseract-b-1">Install: Tesseract binaries</span>

For linux just use install from repository using

```
  sudo yum install tesseract-ocr
```

If you are using Amazon linux please use this instead ([thanks for help](https://stackoverflow.com/questions/38065964/fastest-way-to-install-tesseract-on-elastic-beanstalk)).

```
 sudo yum --enablerepo=epel --disablerepo=amzn-main install libwebp
 sudo yum --enablerepo=epel --disablerepo=amzn-main install tesseract
```

For Windows download installer or zip archieve

```
  <a class="external free" href="https://sourceforge.net/projects/tesseract-ocr-alt/files/" rel="nofollow">https://sourceforge.net/projects/tesseract-ocr-alt/files/</a>
```

Register the location of the **tesseract** executeable in web.xml

```
   <context-param>
       <param-name>ExecutableTerrasect</param-name>
       <param-value>c:\tesseract\tesseract</param-value>
   </context-param>
```