Skip to content

Commit 2b07d71

Browse files
Merge pull request #1955 from syncfusion-content/876039_hotfix
876039: Resolve UG Documentation staging error.
2 parents 6f1f2f9 + 78e3be8 commit 2b07d71

File tree

2 files changed

+67
-35
lines changed

2 files changed

+67
-35
lines changed

File-Formats/PDF/Convert-HTML-To-PDF/troubleshooting.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ You can set the runtimes folder path explicitly in BlinkPath property in BlinkCo
3434
<br/><br/>
3535
Ex path: <i>C:\HtmlConversion\HTMl-to-PDF\HTMl-to-PDF\bin\Debug\net7.0\runtimes\win-x64\native\</i>
3636
<br/><br/>
37-
{% highlight c# tabtitle="C# [Cross-platform]" %}
37+
{% tabs %}
38+
{% highlight C# %}
3839

3940
//Initialize the HTML to PDF converter.
4041
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
@@ -52,6 +53,7 @@ document.Save(fileStream);
5253
document.Close(true);
5354

5455
{% endhighlight %}
56+
{% endtabs %}
5557
</td>
5658
</tr>
5759

@@ -137,13 +139,15 @@ Also, please add the following command line arguments in our converter setting.
137139
<table>
138140
<tr>
139141
<td>
140-
{% highlight %}
142+
{% tabs %}
143+
{% highlight C# tabtitle="C#" %}
141144

142145
//Set command line arguments to run without sandbox.
143146
blinkConverterSettings.CommandLineArguments.Add("--no-sandbox");
144147
blinkConverterSettings.CommandLineArguments.Add("--disable-setuid-sandbox");
145148

146149
{% endhighlight %}
150+
{% endtabs %}
147151
</td>
148152
</tr>
149153
</table>
@@ -247,12 +251,14 @@ blinkConverterSettings.CommandLineArguments.Add("--disable-setuid-sandbox");
247251
</th>
248252
<td>To overcome the exception, you can add read, write, and execute permissions for the temporary folder. Refer to the following code sample to set the temp folder.
249253
<br><br/>
250-
{% highlight %}
254+
{% tabs %}
255+
{% highlight C# tabtitle="C#" %}
251256

252257
BlinkConverterSettings settings = new BlinkConverterSettings();
253258
settings.TempPath = "D://MyProject//bin";
254259

255260
{% endhighlight %}
261+
{% endtabs %}
256262
</td>
257263
</tr>
258264

@@ -330,7 +336,8 @@ Check the HTML file or URL is rendered properly in Chrome browser's print previe
330336
<br><br/>
331337
<img src="htmlconversion_images/Troubleshooting_webpage_exception_Linux.png" alt="ExcludeAssets">
332338
<br><br/>
333-
{% highlight %}
339+
{% tabs %}
340+
{% highlight C# tabtitle="C#" %}
334341

335342
COPY . /app
336343
WORKDIR /app
@@ -339,6 +346,7 @@ RUN chmod +x /app/runtimes/linux/native/chrome && \
339346
chmod +x /app/runtimes/linux/native/chrome-wrapper
340347

341348
{% endhighlight %}
349+
{% endtabs %}
342350
</td>
343351
</tr>
344352
</table>
@@ -362,12 +370,14 @@ RUN chmod +x /app/runtimes/linux/native/chrome && \
362370
</th>
363371
<td>To overcome this issue, add suitable delay for the conversion using the <a href="https://help.syncfusion.com/cr/file-formats/Syncfusion.HtmlConverter.BlinkConverterSettings.html#Syncfusion_HtmlConverter_BlinkConverterSettings_AdditionalDelay">AdditionalDelay</a> property of the HTMLConverter.
364372
<br><br/>
365-
{% highlight %}
373+
{% tabs %}
374+
{% highlight C# tabtitle="C#" %}
366375

367376
BlinkConverterSettings settings = new BlinkConverterSettings();
368377
settings.AdditionalDelay = 4000;
369378

370379
{% endhighlight %}
380+
{% endtabs %}
371381
</td>
372382
</tr>
373383

@@ -431,12 +441,14 @@ Refer to this <a href="https://www.syncfusion.com/kb/10258/how-to-convert-html-t
431441
</th>
432442
<td>You can able to bypass the invalid SSL certificate errors using the command line arguments property of Blink converter settings.
433443
<br><br/>
434-
{% highlight %}
444+
{% tabs %}
445+
{% highlight C# tabtitle="C#" %}
435446

436447
BlinkConverterSettings settings = new BlinkConverterSettings();
437448
settings.CommandLineArguments.Add("--ignore-certificate-errors");
438449

439450
{% endhighlight %}
451+
{% endtabs %}
440452
</td>
441453
</tr>
442454
</table>
@@ -461,13 +473,15 @@ settings.CommandLineArguments.Add("--ignore-certificate-errors");
461473
</th>
462474
<td>We can resolve this permission related failure in the Blink rendering engine using below command line arguments in our converter settings.
463475
<br><br/>
464-
{% highlight %}
476+
{% tabs %}
477+
{% highlight C# tabtitle="C#" %}
465478

466479
//Set command line arguments to run without sandbox.
467480
blinkConverterSettings.CommandLineArguments.Add("--no-sandbox");
468481
blinkConverterSettings.CommandLineArguments.Add("--disable-setuid-sandbox");
469482

470483
{% endhighlight %}
484+
{% endtabs %}
471485
</td>
472486
</tr>
473487
</table>
@@ -591,7 +605,7 @@ To resolve this issue, we can install the chromium using the docker file and set
591605
Docker File:<br><br>
592606
{% tabs %}
593607

594-
{% highlight %}
608+
{% highlight C# tabtitle="C#" %}
595609

596610
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
597611

@@ -615,9 +629,12 @@ Docker File:<br><br>
615629

616630
{% endhighlight %}
617631

632+
{% endtabs %}
633+
618634
Code snippet:
635+
{% tabs %}
619636

620-
{% highlight %}
637+
{% highlight C# tabtitle="C#" %}
621638

622639
BlinkConverterSettings settings = new BlinkConverterSettings();
623640

@@ -657,7 +674,7 @@ To resolve this issue, we can add inline styles in element. However, we have att
657674

658675
{% tabs %}
659676

660-
{% highlight c# tabtitle="C# [Cross-platform]" %}
677+
{% highlight C# tabtitle="C#" %}
661678

662679
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
663680
//Initialize blink converter settings.
@@ -698,7 +715,7 @@ You can downloaded a complete working sample from [GitHub](https://github.com/Sy
698715

699716
{% tabs %}
700717

701-
{% highlight %}
718+
{% highlight C# %}
702719

703720
//Set command line arguments to run without the sandbox.
704721

File-Formats/PDF/Working-with-OCR/Troubleshooting.md

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ keywords: Assemblies
2525
<td>
2626
Set proper tesseract binaries and tessdata folder with all files and inner folders. The tessdata folder name is case-sensitive and should not change.
2727
<br/><br/>
28-
{% highlight c# tabtitle="C# [Cross-platform]" %}
28+
{% tabs %}
29+
{% highlight C# tabtitle="C# [Cross-platform]" %}
2930

3031
//TesseractBinaries - path of the folder tesseract binaries.
3132
OCRProcessor processor = new OCRProcessor(@"TesseractBinaries/");
@@ -34,6 +35,7 @@ OCRProcessor processor = new OCRProcessor(@"TesseractBinaries/");
3435
processor.PerformOCR(lDoc, @"TessData/");
3536

3637
{% endhighlight %}
38+
{% endtabs %}
3739
</td>
3840
</tr>
3941
<tr>
@@ -180,36 +182,41 @@ By using the best tessdata, we can improve the OCR results. For more information
180182
<br><br/>
181183
1.Execute the following command to install Tesserat 5.
182184
<br><br/>
183-
{% highlight %}
185+
{% tabs %}
186+
{% highlight C# %}
184187

185188
brew install tesseract
186189

187190
{% endhighlight %}
188-
191+
{% endtabs %}
189192
<br><br/>
190193
If the "brew" is not installed on your machine, you can install it using the following command.
191194
<br><br/>
192-
{% highlight %}
195+
{% tabs %}
196+
{% highlight C# %}
193197

194198
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
195199

196200
{% endhighlight %}
197-
201+
{% endtabs %}
198202
<br><br/>
199203

200204
2.Once Tesseract 5 is successfully installed, you can configure the path to the latest binaries by copying the location of the Tesseract folder and setting it as the Tesseract binaries path when setting up the OCR processor. Refer to the example code below:
201205
<br><br/>
202-
{% highlight %}
206+
{% tabs %}
207+
{% highlight C# %}
203208

204209
//Initialize the OCR processor by providing the path of tesseract binaries.
205210
using (OCRProcessor processor = new OCRProcessor("/opt/homebrew/Cellar/tesseract/5.3.2/lib"))
206211

207212
{% endhighlight %}
213+
{% endtabs %}
208214
<br><br/>
209215

210216
3.Add the TessDataPath from bin folder. Refer to the example code below:
211217
<br></br>
212-
{% highlight c# tabtitle="C# [Cross-platform]" %}
218+
{% tabs %}
219+
{% highlight C# tabtitle="C# [Cross-platform]" %}
213220

214221
using (OCRProcessor processor = new OCRProcessor("/opt/homebrew/Cellar/tesseract/5.3.2/lib"))
215222
{
@@ -232,6 +239,7 @@ using (OCRProcessor processor = new OCRProcessor("/opt/homebrew/Cellar/tesseract
232239
}
233240

234241
{% endhighlight %}
242+
{% endtabs %}
235243
</td>
236244
</tr>
237245
</table>
@@ -253,38 +261,45 @@ using (OCRProcessor processor = new OCRProcessor("/opt/homebrew/Cellar/tesseract
253261
<br><br/>
254262
1. Install the leptonica.
255263
<br>
256-
{% highlight %}
264+
{% tabs %}
265+
{% highlight C# %}
257266

258267
sudo apt-get install libleptonica-dev
259268

260269
{% endhighlight %}
270+
{% endtabs %}
261271
<br><br>
262272
<img src="OCR-Images/Install-leptonica.png">
263273
<br><br>
264274
2.Install the tesseract.
265275
<br>
266-
267-
{% highlight %}
276+
{% tabs %}
277+
{% highlight C# %}
268278

269279
sudo apt-get install tesseract-ocr-eng
270280

271281
{% endhighlight %}
282+
{% endtabs %}
272283
<br><br>
273284
<img src="OCR-Images/Install-tesseract.png">
274285
<br><br>
275286
3. Copy the binaries (liblept.so and libtesseract.so) to the missing files exception folder in the project location.
276287
<br>
277-
{% highlight c# tabtitle="C#" %}
288+
{% tabs %}
289+
{% highlight C# %}
278290

279291
cp /usr/lib/x86_64-linux-gnu/liblept.so /home/syncfusion/linuxdockersample/linuxdockersample/bin/Debug/net7.0/liblept1753.so
280292

281293
{% endhighlight %}
294+
{% endtabs %}
282295
<br>
283-
{% highlight %}
296+
{% tabs %}
297+
{% highlight C# %}
284298

285299
cp /usr/lib/x86_64-linux-gnu/libtesseract.so.4 /home/syncfusion/linuxdockersample/linuxdockersample/bin/Debug/net7.0/libSyncfusionTesseract.so
286300

287301
{% endhighlight %}
302+
{% endtabs %}
288303
<br/>
289304
</td>
290305
</tr>
@@ -308,39 +323,39 @@ cp /usr/lib/x86_64-linux-gnu/libtesseract.so.4 /home/syncfusion/linuxdockersampl
308323
To resolve this problem, you should install all required dependencies in your Linux machine. Refer to the following steps to installing the missing dependencies.
309324

310325
Step 1: Execute the following command in terminal window to check dependencies are installed properly.
311-
312-
{% highlight %}
326+
{% tabs %}
327+
{% highlight C# %}
313328

314329
ldd liblept1753.so
315330
ldd libSyncfusionTesseract.so
316331

317332
{% endhighlight %}
318-
333+
{% endtabs %}
319334
Run the following commands in terminal
320335
Step 1:
321-
322-
{% highlight %}
336+
{% tabs %}
337+
{% highlight C# %}
323338

324339
sudo apt-get install libleptonica-dev libjpeg62
325340

326341
{% endhighlight %}
327-
342+
{% endtabs %}
328343
Step 2:
329-
330-
{% highlight %}
344+
{% tabs %}
345+
{% highlight C# %}
331346

332347
ln -s /usr/lib/x86_64-linux-gnu/libtiff.so.6 /usr/lib/x86_64-linux-gnu/libtiff.so.5
333348

334349
{% endhighlight %}
335-
350+
{% endtabs %}
336351
Step 3:
337-
338-
{% highlight %}
352+
{% tabs %}
353+
{% highlight C# %}
339354

340355
ln -s /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so
341356

342357
{% endhighlight %}
343-
358+
{% endtabs %}
344359
</td>
345360
</tr>
346361
</table>

0 commit comments

Comments
 (0)