Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified en/.gitbook/assets/perform-ocr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 25 additions & 9 deletions en/advanced/OCR.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,36 @@
OCRmyPDF must be installed on your system to use this feature.
{% endhint %}

1. Open JabRef and select the entry with the scanned PDF you want to OCR.
2. Open the General Tab of the Entry Editor.
3. Right-click on the File and select "Perform OCR and embed text into new PDF file". ![perform-ocr.png](../.gitbook/assets/perform-ocr.png)
1. Open JabRef and select the entry with the PDFs you want to OCR.
2. Scroll down the Main Tab of the Entry Editor till you reach the Files and Links section.
3. Right-click on the File and select "Perform OCR and embed text into new PDF file", or select the file and use the shortcut `Ctrl+Shift+R`. ![Perform OCR](../.gitbook/assets/perform-ocr.png)

* After performing OCR, JabRef creates a new PDF file with the OCR text embedded, and it will be linked to all the entries that have the old file linked to them. The original scanned PDF will remain unchanged.

![original-and-ocred-files.png](../.gitbook/assets/original-and-ocred-files.png)
![Original and OCRed files](../.gitbook/assets/original-and-ocred-files.png)

* Now you can select and search text in the new PDF file.

![comparison-between-original-and-ocred-file.png](../.gitbook/assets/comparison-between-original-and-ocred-file.png)
![Comparison between original and OCRed file](../.gitbook/assets/comparison-between-original-and-ocred-file.png)

## OCR Preferences

* The OCR preferences can be accessed via **File → Preferences → OCR**.

![ocr-preferences.png](../.gitbook/assets/ocr-preferences.png)
![OCR preferences](../.gitbook/assets/ocr-preferences.png)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen other apps structure OCR preferences via "Input" vs "Output".

### Partially scanned PDFs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatives:

  1. handling of pre-existing text
  2. handling of original embedded text
  3. handling of text input
  4. text creation handling
  5. handling of text creation
  6. text flow handling
  7. handling of source text

I am not quite sure what is best, but tend to favour 1 or 2. What do you think?
"Partially scanned PDFs" doesn't seem to be entirely correct. First of all we are not scanning. Secondly, overwriting is not handling it partially.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would go with option 1.
Unfortunately I don't have access to my laptop right now.


* Some PDFs may contain a mix of pages with and without embedded text.
* In such cases, you will have three options:

1. **Skip pages with text**: Performs OCR only on the pages without already embedded text. This is the default behaviour, if not specified.
2. **Redo text in pages containing OCRed text**: Uses OCR on pages containing text created by a prior OCR run.
3. **Overwrite text in pages containing text**: Forces OCR with rasterization on all pages, potentially reducing quality or losing vector content, but this technique works, even when the `Redo text in pages containing text` option doesn't work.

* This can be configured in Partially scanned PDFs section in the OCR preferences.

![OCR options for partially scanned PDFs](../.gitbook/assets/ocr-options-for-partially-scanned-pdfs.png)

### Engine Path

Expand All @@ -41,13 +55,15 @@ Performing OCR will fail if wrong engine path is provided, make sure that the co

1. **Type the path manually**: Enter the path directly into the text field. This can be a bare command name (e.g. `ocrmypdf` or `python -m ocrmypdf`) if it is available on your system PATH, or a full absolute path to the executable (e.g. `/home/user/.local/bin/ocrmypdf`).

![text-field-for-engine-path.png](../.gitbook/assets/text-field-for-engine-path.png)
![Text field for engine path](../.gitbook/assets/text-field-for-engine-path.png)

2. **Browse**: Click the folder icon to open a file chooser and navigate to the OCRmyPDF executable on your system.

![browse-engine-path-button.png](../.gitbook/assets/browse-engine-path-button.png)
![Browse engine path button](../.gitbook/assets/browse-engine-path-button.png)

3. **Auto-detect**: Click the magnifier icon to have JabRef automatically search for a working OCRmyPDF installation. JabRef will try the following commands in order and use the first one that works:

![auto-detect-engine-path-button.png](../.gitbook/assets/auto-detect-engine-path-button.png)
![Auto-detect engine path button](../.gitbook/assets/auto-detect-engine-path-button.png)

1. `ocrmypdf`
2. `python -m ocrmypdf`
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified en/advanced/perform-ocr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading