Skip to content
Merged
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
2 changes: 1 addition & 1 deletion File-Formats/PDF/Working-with-OCR/MAC.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ using (OCRProcessor processor = new OCRProcessor())
By executing the program, you will get a PDF document as follows.
![WPF OCR output screenshot](OCR-Images/Output.png)

A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/WPF).
A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Mac).

Click [here](https://www.syncfusion.com/document-processing/pdf-framework/net) to explore the rich set of Syncfusion PDF library features.

27 changes: 27 additions & 0 deletions File-Formats/PDF/Working-with-OCR/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,33 @@ If the "brew" is not installed on your machine, you can install it using the fol
//Initialize the OCR processor by providing the path of tesseract binaries.
using (OCRProcessor processor = new OCRProcessor("/opt/homebrew/Cellar/tesseract/5.3.2/lib"))

{% endhighlight %}
<br><br/>

3.Add the TessDataPath from bin folder. Refer to the example code below:
<br></br>
{% highlight c# tabtitle="C#" %}

using (OCRProcessor processor = new OCRProcessor("/opt/homebrew/Cellar/tesseract/5.3.2/lib"))
{
FileStream fileStream = new FileStream("../../../Input.pdf", FileMode.Open, FileAccess.Read);
//Load a PDF document.
PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream);
//Set OCR language to process.
processor.Settings.Language = Languages.English;
//Process OCR by providing the PDF document.
processor.TessDataPath = "runtimes/tessdata";
processor.PerformOCR(lDoc);
//Create file stream.
using (FileStream outputFileStream = new FileStream("Output.pdf", FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document to file stream.
lDoc.Save(outputFileStream);
}
//Close the document.
lDoc.Close(true);
}

{% endhighlight %}
</td>
</tr>
Expand Down