Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
docs(user): mention changes to OCR
Elian Doran3381bbfbf250
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Templates.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Templates.htmlindex 2cbee3650a..8e423e6c31 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Templates.html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Templates.html@@ -58,17 +58,17 @@Only the structure present at the time of note creation is considered.</p></aside><h2>Regarding note types</h2>-<p>By default, newly created notes are <a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_iPIMuisry3hd">Text</a> notes.+<p>By default, newly created notes are <a class="reference-link" href="#root/_help_iPIMuisry3hd">Text</a> notes.If a parent note defines a <code spellcheck="false">child:template</code> pointingto a template of a different type (e.g. a Code note), the behavior dependson how the new note is created:</p><ul><li>If no note type is explicitly chosen (e.g. the + button in the <a- class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_oPVyFC7WL2Lp">Note Tree</a>), the template is applied and the new note takes the type+ class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>), the template is applied and the new note takes the typeand content of the template.</li><li>If a note type is explicitly selected (e.g. <a class="reference-link"- href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_oPVyFC7WL2Lp">Note Tree</a> → <em>Insert note after</em> / <em>Insert child note</em>):+ href="#root/_help_oPVyFC7WL2Lp">Note Tree</a> → <em>Insert note after</em> / <em>Insert child note</em>):<ul><li>If the selected type matches the template's type, the template is applied.</li><li>If the selected type differs, the template is disregarded entirely — the@@ -83,11 +83,11 @@<codespellcheck="false">#cssClass</code>attributes, allowing all instance notes (e.g., books)to display a specific icon and CSS style.</p>-<p>Explore the concept further in the <a class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/wX4HbRucYSDD/_help_6tZeKvSHEUiB">Demo Notes</a>,- including examples like the <a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_iRwzGnHPzonm">Relation Map</a>, +<p>Explore the concept further in the <a class="reference-link" href="#root/_help_6tZeKvSHEUiB">Demo Notes</a>,+ including examples like the <a class="reference-link" href="#root/_help_iRwzGnHPzonm">Relation Map</a>, <a- class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/5668rwcirq1t/_help_xYjQUYhpbUEW">Task Manager</a>, and <a class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/5668rwcirq1t/_help_l0tKav7yLHGF">Day Notes</a>.</p>-<p>Additionally, see <a class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/_help_47ZrP6FNuoG8">Default Note Title</a> for+ class="reference-link" href="#root/_help_xYjQUYhpbUEW">Task Manager</a>, and <a class="reference-link" href="#root/_help_l0tKav7yLHGF">Day Notes</a>.</p>+<p>Additionally, see <a class="reference-link" href="#root/_help_47ZrP6FNuoG8">Default Note Title</a> forcreating title templates. Note templates and title templates can be combinedby creating a <code spellcheck="false">#titleTemplate</code> for a templatenote.</p>\ No newline at end of filediff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Text Extraction (OCR).html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Text Extraction (OCR).htmlindex eff5c7718c..ff383c05d1 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Text Extraction (OCR).html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Text Extraction (OCR).html@@ -31,96 +31,103 @@<li>The underlying technology is Tesseract.js.</li></ul><h3>PDFs</h3>-<p>Currently only text extraction is supported and not OCR.</p>+<p>The PDF extraction supports:</p><ul>- <li>This means that the PDF needs to have proper text information in it (i.e.- the text can be selected in a PDF viewer), whereas scanned documents are- not yet supported.</li>- <li>There are plans to integrate the same OCR-based recognition for PDFs used- for images, but this is not yet implemented.</li>+ <li>PDFs with text information (e.g. a PDF created by a browser or a word+ processing application), in which the text is extracted.</li>+ <li>Scanned PDFs, in which the text is extracted through an OCR process.</li>+ <li>Mixed PDFs, containing both text and images with text content.</li></ul>-<h3>Office documents</h3>-<p>The text will be extracted from the following file formats:</p>-<ul>- <li>Microsoft Word documents</li>- <li>Microsoft Excel documents- <ul>- <li>Only the raw text information, the cell structure is not maintained.</li>- <li>Values are extracted raw, so searching for dates will not work. The OpenDocument- alternative will actually extract the properly formatted value.</li>- </ul>- </li>- <li>Microsoft PowerPoint documents</li>- <li>The OpenDocument alternatives to the previous formats (Text, Spreadsheet,- Presentation), created by editors such as LibreOffice and OpenOffice.</li>- <li>Rich Text Format (RTF), since v0.104.0.</li>-</ul>-<h2>Configuring and triggering OCR</h2>-<p>The OCR can be configured by going to <a class="reference-link" href="#root/_help_4TIF1oA4VQRO">Options</a> → - <a- class="reference-link" href="#root/_hidden/_options/_optionsMedia">Media</a> and looking for the <em>Text Extraction (OCR)</em> section.</p>-<p>There are three ways to trigger the OCR:</p>-<ul>- <li>By enabling <em>Auto-process new files</em> which will process only the- notes or attachments created after enabling the option, existing files- will remain unprocessed.</li>- <li>By pressing <em>Start Batch Processing</em> which will process all the existing- notes.</li>- <li>By manually requesting for an image or file to have its text extracted,- regardless of whether the automatic processing is enabled or not.</li>-</ul>-<h3>Minimum confidence</h3>-<p>When extracting text from an image, there is a certain level of confidence- which indicates whether the extracted text appears relevant.</p>-<p>When the minimum confidence is set to a low percentage, the text extraction- can interpret symbols and drawings incorrectly resulting in garbled text.</p>-<p>If the extracted text for a note or an attachment quality is lower than- the minimum confidence, the OCR is disregarded.</p>-<h2>Language management</h2>-<p>OCR needs to be aware of the language of the content in order for it to- work correctly. The reason is that each language has its own data which- needs to be downloaded, and accents or other symbols will not be supported- by the default language.</p>-<p>To configure the languages that are supported by the OCR, simply go to - <a- class="reference-link" href="#root/_help_4TIF1oA4VQRO">Options</a> → <a class="reference-link" href="#root/_hidden/_options/_optionsLocalization">Language & Region</a> and- adjust the <em>Content languages</em>.</p>-<p>When there are no content languages defined, the user interface <em>Language</em> is- used instead.</p>-<p>After making this change, the automatic processing or manual reprocessing- will take into consideration the new languages.</p>-<p>To enforce the detection in a particular language for a given note, use- the <code spellcheck="false">language</code> <a href="#root/_help_zEY4DaJG4YT5">attribute</a>,- similar to <a href="#root/_help_veGu4faJErEM">text content language</a>. For - <a- class="reference-link" href="#root/_help_0vhv7lsOLy82">Attachments</a>, it's not possible to manually adjust the language.</p>+<p>Note that OCR extraction is limited to 50 pages per PDF, pages containing+ text information (not as an image) are not subject to this limitation.</p><asideclass="admonition note">- <p>The trained data for each language is not packaged with Trilium, as that- would require a significant amount of space that might not be otherwise- needed. As such, when the trained data will be downloaded automatically- via <a href="https://github.com/naptha/tesseract.js/">Tesseract.js</a>.</p>- <p>The downloaded trained data is located in the <a class="reference-link"- href="#root/_help_tAassRL4RSQL">Data directory</a>, in the <code spellcheck="false">ocr-cache</code> directory.</p>+ <p>Text extraction for scanned PDF using OCR was introduced in v0.104.0,+ so you might have to reprocess your existing documents (either individually+ or in bulk, see below).</p></aside>- <h2>Viewing extracted content for a single note</h2>- <p>To access the extracted content of a note:</p>+ <h3>Office documents</h3>+ <p>The text will be extracted from the following file formats:</p><ul>- <li>For <a class="reference-link" href="#root/_help_W8vYD3Q1zjCR">File</a> notes,- go to the <a class="reference-link" href="#root/_help_8YBEPzcpUgxw">Note buttons</a> → <em>Advanced</em> → <em>View OCR Text</em>.</li>- <li>For <a class="reference-link" href="#root/_help_0vhv7lsOLy82">Attachments</a> (e.g. - <a- class="reference-link" href="#root/_help_mT0HEkOsz6i1">Images</a> in <a class="reference-link" href="#root/_help_iPIMuisry3hd">Text</a> notes),- double-click the attachment to view the details, press the […] button at- the left and select <em>View extracted text (OCR)</em>.</li>+ <li>Microsoft Word documents</li>+ <li>Microsoft Excel documents+ <ul>+ <li>Only the raw text information, the cell structure is not maintained.</li>+ <li>Values are extracted raw, so searching for dates will not work. The OpenDocument+ alternative will actually extract the properly formatted value.</li>+ </ul>+ </li>+ <li>Microsoft PowerPoint documents</li>+ <li>The OpenDocument alternatives to the previous formats (Text, Spreadsheet,+ Presentation), created by editors such as LibreOffice and OpenOffice.</li>+ <li>Rich Text Format (RTF), since v0.104.0.</li></ul>- <p>This section allows:</p>+ <h2>Configuring and triggering OCR</h2>+ <p>The OCR can be configured by going to <a class="reference-link" href="#root/_help_4TIF1oA4VQRO">Options</a> → + <a+ class="reference-link" href="#root/_hidden/_options/_optionsMedia">Media</a> and looking for the <em>Text Extraction (OCR)</em> section.</p>+ <p>There are three ways to trigger the OCR:</p><ul>- <li>Viewing the extracted text, which can be copied elsewhere if needed or- just to check the quality of the extraction.</li>- <li>If the note has not been extracted yet, pressing <em>Process OCR</em> will- process it in the background. If the extraction confidence is lower than- the minimum confidence, there will be a notification.</li>- <li>Similarly, if the minimum confidence was changed in settings, it is possible- to press the <em>Process OCR</em> button again to extract the text again.</li>- </ul>\ No newline at end of file+ <li>By enabling <em>Auto-process new files</em> which will process only the+ notes or attachments created after enabling the option, existing files+ will remain unprocessed.</li>+ <li>By pressing <em>Start Batch Processing</em> which will process all the existing+ notes.</li>+ <li>By manually requesting for an image or file to have its text extracted,+ regardless of whether the automatic processing is enabled or not.</li>+ </ul>+ <h3>Minimum confidence</h3>+ <p>When extracting text from an image, there is a certain level of confidence+ which indicates whether the extracted text appears relevant.</p>+ <p>When the minimum confidence is set to a low percentage, the text extraction+ can interpret symbols and drawings incorrectly resulting in garbled text.</p>+ <p>If the extracted text for a note or an attachment quality is lower than+ the minimum confidence, the OCR is disregarded.</p>+ <h2>Language management</h2>+ <p>OCR needs to be aware of the language of the content in order for it to+ work correctly. The reason is that each language has its own data which+ needs to be downloaded, and accents or other symbols will not be supported+ by the default language.</p>+ <p>To configure the languages that are supported by the OCR, simply go to + <a+ class="reference-link" href="#root/_help_4TIF1oA4VQRO">Options</a> → <a class="reference-link" href="#root/_hidden/_options/_optionsLocalization">Language & Region</a> and+ adjust the <em>Content languages</em>.</p>+ <p>When there are no content languages defined, the user interface <em>Language</em> is+ used instead.</p>+ <p>After making this change, the automatic processing or manual reprocessing+ will take into consideration the new languages.</p>+ <p>To enforce the detection in a particular language for a given note, use+ the <code spellcheck="false">language</code> <a href="#root/_help_zEY4DaJG4YT5">attribute</a>,+ similar to <a href="#root/_help_veGu4faJErEM">text content language</a>. For + <a+ class="reference-link" href="#root/_help_0vhv7lsOLy82">Attachments</a>, it's not possible to manually adjust the language.</p>+ <aside+ class="admonition note">+ <p>The trained data for each language is not packaged with Trilium, as that+ would require a significant amount of space that might not be otherwise+ needed. As such, when the trained data will be downloaded automatically+ via <a href="https://github.com/naptha/tesseract.js/">Tesseract.js</a>.</p>+ <p>The downloaded trained data is located in the <a class="reference-link"+ href="#root/_help_tAassRL4RSQL">Data directory</a>, in the <code spellcheck="false">ocr-cache</code> directory.</p>+ </aside>+ <h2>Viewing extracted content for a single note</h2>+ <p>To access the extracted content of a note:</p>+ <ul>+ <li>For <a class="reference-link" href="#root/_help_W8vYD3Q1zjCR">File</a> notes,+ go to the <a class="reference-link" href="#root/_help_8YBEPzcpUgxw">Note buttons</a> → <em>Advanced</em> → <em>View OCR Text</em>.</li>+ <li>For <a class="reference-link" href="#root/_help_0vhv7lsOLy82">Attachments</a> (e.g. + <a+ class="reference-link" href="#root/_help_mT0HEkOsz6i1">Images</a> in <a class="reference-link" href="#root/_help_iPIMuisry3hd">Text</a> notes),+ double-click the attachment to view the details, press the […] button at+ the left and select <em>View extracted text (OCR)</em>.</li>+ </ul>+ <p>This section allows:</p>+ <ul>+ <li>Viewing the extracted text, which can be copied elsewhere if needed or+ just to check the quality of the extraction.</li>+ <li>If the note has not been extracted yet, pressing <em>Process OCR</em> will+ process it in the background. If the extraction confidence is lower than+ the minimum confidence, there will be a notification.</li>+ <li>Similarly, if the minimum confidence was changed in settings, it is possible+ to press the <em>Process OCR</em> button again to extract the text again.</li>+ </ul>\ No newline at end of filediff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.jsonindex f408286ab2..501b5568df 100644--- a/docs/User Guide/!!!meta.json+++ b/docs/User Guide/!!!meta.json@@ -15742,67 +15742,67 @@"position": 30},{- "type": "label",- "name": "shareAlias",- "value": "template",- "isInheritable": false,- "position": 30- },- {- "type": "label",- "name": "iconClass",- "value": "bx bx-copy",+ "type": "relation",+ "name": "internalLink",+ "value": "iPIMuisry3hd","isInheritable": false,- "position": 110+ "position": 40},{"type": "relation","name": "internalLink",- "value": "47ZrP6FNuoG8",+ "value": "oPVyFC7WL2Lp","isInheritable": false,- "position": 120+ "position": 50},{"type": "relation","name": "internalLink","value": "6tZeKvSHEUiB","isInheritable": false,- "position": 130+ "position": 60},{"type": "relation","name": "internalLink","value": "iRwzGnHPzonm","isInheritable": false,- "position": 140+ "position": 70},{"type": "relation","name": "internalLink","value": "xYjQUYhpbUEW","isInheritable": false,- "position": 150+ "position": 80},{"type": "relation","name": "internalLink","value": "l0tKav7yLHGF","isInheritable": false,- "position": 160+ "position": 90},{"type": "relation","name": "internalLink",- "value": "iPIMuisry3hd",+ "value": "47ZrP6FNuoG8","isInheritable": false,- "position": 170+ "position": 100},{- "type": "relation",- "name": "internalLink",- "value": "oPVyFC7WL2Lp",+ "type": "label",+ "name": "shareAlias",+ "value": "template","isInheritable": false,- "position": 180+ "position": 30+ },+ {+ "type": "label",+ "name": "iconClass",+ "value": "bx bx-copy",+ "isInheritable": false,+ "position": 110}],"format": "markdown",diff --git a/docs/User Guide/User Guide/Advanced Usage/Text Extraction (OCR).md b/docs/User Guide/User Guide/Advanced Usage/Text Extraction (OCR).mdindex 67afffef62..4c10bedaa8 100644--- a/docs/User Guide/User Guide/Advanced Usage/Text Extraction (OCR).md+++ b/docs/User Guide/User Guide/Advanced Usage/Text Extraction (OCR).md@@ -27,10 +27,16 @@ OCR in Trilium supports the following formats:### PDFs-Currently only text extraction is supported and not OCR.+The PDF extraction supports:-* This means that the PDF needs to have proper text information in it (i.e. the text can be selected in a PDF viewer), whereas scanned documents are not yet supported.-* There are plans to integrate the same OCR-based recognition for PDFs used for images, but this is not yet implemented.+* PDFs with text information (e.g. a PDF created by a browser or a word processing application), in which the text is extracted.+* Scanned PDFs, in which the text is extracted through an OCR process.+* Mixed PDFs, containing both text and images with text content.++Note that OCR extraction is limited to 50 pages per PDF, pages containing text information (not as an image) are not subject to this limitation.++> [!NOTE]+> Text extraction for scanned PDF using OCR was introduced in v0.104.0, so you might have to reprocess your existing documents (either individually or in bulk, see below).### Office documents