From bb0547e3a8a96941f43f9b9c6ccf45bae2615aea Mon Sep 17 00:00:00 2001 From: Srihariharan Date: Thu, 29 Feb 2024 10:47:08 +0530 Subject: [PATCH 1/2] 873365: Revamping the OCR Linux prerequisites command. --- .../PDF/Convert-HTML-To-PDF/troubleshooting.md | 2 -- File-Formats/PDF/Working-with-OCR/Linux.md | 10 ++++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/File-Formats/PDF/Convert-HTML-To-PDF/troubleshooting.md b/File-Formats/PDF/Convert-HTML-To-PDF/troubleshooting.md index 785a670e9..f03701a6a 100644 --- a/File-Formats/PDF/Convert-HTML-To-PDF/troubleshooting.md +++ b/File-Formats/PDF/Convert-HTML-To-PDF/troubleshooting.md @@ -657,8 +657,6 @@ To resolve this issue, we can add inline styles in element. However, we have att {% tabs %} -Code sample: - {% highlight c# tabtitle="C#" %} HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(); diff --git a/File-Formats/PDF/Working-with-OCR/Linux.md b/File-Formats/PDF/Working-with-OCR/Linux.md index fef4a88a8..b62bfa231 100644 --- a/File-Formats/PDF/Working-with-OCR/Linux.md +++ b/File-Formats/PDF/Working-with-OCR/Linux.md @@ -21,6 +21,16 @@ sudo apt-get install libc6-dev {% endhighlight %} +{% highlight c# tabtitle="C#" %} + +sudo apt-get install libleptonica-dev libjpeg62 + +ln -s /usr/lib/x86_64-linux-gnu/libtiff.so.6 /usr/lib/x86_64-linux-gnu/libtiff.so.5 + +ln -s /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so + +{% endhighlight %} + ## Steps to convert HTML to PDF in .NET Core application on Linux Step 1: Execute the following command in the Linux terminal to create a new .NET Core Console application. From 8e66a148de97d78861797514f8be415f9a08a0fa Mon Sep 17 00:00:00 2001 From: Srihariharan Date: Fri, 1 Mar 2024 10:24:34 +0530 Subject: [PATCH 2/2] 873365: Added OCR Linux prerequisites command in troubleshooting page. --- File-Formats/PDF/Working-with-OCR/Linux.md | 9 --- .../PDF/Working-with-OCR/Troubleshooting.md | 55 +++++++++++++++++++ 2 files changed, 55 insertions(+), 9 deletions(-) diff --git a/File-Formats/PDF/Working-with-OCR/Linux.md b/File-Formats/PDF/Working-with-OCR/Linux.md index b62bfa231..68742a6bf 100644 --- a/File-Formats/PDF/Working-with-OCR/Linux.md +++ b/File-Formats/PDF/Working-with-OCR/Linux.md @@ -21,15 +21,6 @@ sudo apt-get install libc6-dev {% endhighlight %} -{% highlight c# tabtitle="C#" %} - -sudo apt-get install libleptonica-dev libjpeg62 - -ln -s /usr/lib/x86_64-linux-gnu/libtiff.so.6 /usr/lib/x86_64-linux-gnu/libtiff.so.5 - -ln -s /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so - -{% endhighlight %} ## Steps to convert HTML to PDF in .NET Core application on Linux diff --git a/File-Formats/PDF/Working-with-OCR/Troubleshooting.md b/File-Formats/PDF/Working-with-OCR/Troubleshooting.md index 66be789c2..98c7f884e 100644 --- a/File-Formats/PDF/Working-with-OCR/Troubleshooting.md +++ b/File-Formats/PDF/Working-with-OCR/Troubleshooting.md @@ -286,6 +286,61 @@ cp /usr/lib/x86_64-linux-gnu/libtesseract.so.4 /home/syncfusion/linuxdockersampl {% endhighlight %}
+ + + + + +## OCR not working on Linux: Exception has been thrown by the target of an invocation + + + + + + + + + + +
IssueSyncfusion.Pdf.PdfException: Exception has been thrown by the target of an invocation" in the Linux machine.
Reason +The problem occurs due to the missing prerequisites dependencies on your Linux machine. +
Solution +To resolve this problem, you should install all required dependencies in your Linux machine. Refer to the following steps to installing the missing dependencies. + +Step 1: Execute the following command in terminal window to check dependencies are installed properly. + +{% highlight %} + + ldd liblept1753.so + ldd libSyncfusionTesseract.so + +{% endhighlight %} + +Run the following commands in terminal +Step 1: + +{% highlight %} + + sudo apt-get install libleptonica-dev libjpeg62 + +{% endhighlight %} + +Step 2: + +{% highlight %} + + ln -s /usr/lib/x86_64-linux-gnu/libtiff.so.6 /usr/lib/x86_64-linux-gnu/libtiff.so.5 + +{% endhighlight %} + +Step 3: + +{% highlight %} + + ln -s /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so + +{% endhighlight %} +
\ No newline at end of file