Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, March 11, 2019 1:37:40 AM(UTC)

deniz  
deniz

Groups: Registered
Posts: 7


Hello
We are licensed user of Leadtools v18. We develope a small application to convert image pdfs to searchable pdfs.
But the generation process stays unresponsive at some pdf files. There is no progress, no exception.

I have posted two pdf files. They are almost exactly same but a few data like name, surname.
Generation process is being completed successfully on 00135.pdf file. No problem, it's ok.
But 00136.pdf file is being locked at 40% of FindZone process.

I have tried AutoZone and AutoPreProcess functions but no success.

What would be your suggest about this problem? Thank you for your help.

File Attachment(s):
00135.pdf (292kb) downloaded 50 time(s).
File Attachment(s):
00136.pdf (290kb) downloaded 50 time(s).


here is output:
Page:00(00:00) 005% Operation:FindZones
Page:00(00:00) 040% Operation:FindZones
The thread 0x31d8 has exited with code 0 (0x0).
The thread 0x433c has exited with code 0 (0x0).
The thread 0x6288 has exited with code 0 (0x0).

My Code:
DocumentWriter docWriter = new DocumentWriter();

IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false);

ocrEngine.Startup(null, docWriter, null, Application.StartupPath);

PdfDocumentOptions pdfOptions = docWriter.GetOptions(DocumentFormat.Pdf) as PdfDocumentOptions;
pdfOptions.ImageOverText = true;

string singlePageSearchablePDFAddress = "00136.pdf";

using (IOcrDocument ocrDocument = ocrEngine.DocumentManager.CreateDocument())
{
docWriter.BeginDocument(singlePageSearchablePDFAddress, DocumentFormat.Pdf);

ocrDocument.Pages.AddPage(singlePageImagePDFAddress, null);

try
{
//ocrDocument.Pages[0].AutoPreprocess(OcrAutoPreprocessPageCommand.All, new OcrProgressCallback(MyOcrProgressCallback));
//ocrDocument.Pages[0].AutoZone(new OcrProgressCallback(MyOcrProgressCallback));

ocrDocument.Pages.Recognize(new OcrProgressCallback(MyOcrProgressCallback));
ocrDocument.Save(singlePageSearchablePDFAddress, DocumentFormat.Pdf, null);
docWriter.EndDocument();
}
catch (Exception)
{

docWriter.EndDocument();
File.Delete(singlePageSearchablePDFAddress);
File.Copy(singlePageImagePDFAddress, singlePageSearchablePDFAddress);
}
finally
{

}

}
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, March 12, 2019 4:44:29 PM(UTC)
Anthony Northrup

Groups: Registered, Tech Support, Administrators
Posts: 199

Was thanked: 28 time(s) in 28 post(s)

Hello Deniz,

There are a few issues with your code, though I'm not sure if they would be causing the issue you're seeing. I've attached a complete sample project which contains the corrected version of the code you sent me. Note, some of the variables you used were not defined in your code, so I've cleaned it up a bit. Please make sure to update the config section at the top of the application before running.
File Attachment(s):
OcrTest.zip (4kb) downloaded 51 time(s).
The project also contains a bit of .NET reflection so it can log the DLLs used by the application, but that happens at the end. The full output when running on my system was:
Code:

BEGIN Recognize
  Page: 1, Operation: FindZones 0%
  Page: 1, Operation: FindZones 5%
  Page: 1, Operation: FindZones 65%
  Page: 1, Operation: FindZones 85%
  Page: 1, Operation: FindZones 100%
  Page: 1, Operation: RecognizeFirstPass 0%
  Page: 1, Operation: RecognizeFirstPass 1%
  Page: 1, Operation: RecognizeFirstPass 2%
  Page: 1, Operation: RecognizeFirstPass 4%
  Page: 1, Operation: RecognizeFirstPass 5%
  Page: 1, Operation: RecognizeFirstPass 7%
  Page: 1, Operation: RecognizeFirstPass 8%
  Page: 1, Operation: RecognizeFirstPass 9%
  Page: 1, Operation: RecognizeFirstPass 10%
  Page: 1, Operation: RecognizeFirstPass 11%
  Page: 1, Operation: RecognizeFirstPass 13%
  Page: 1, Operation: RecognizeFirstPass 14%
  Page: 1, Operation: RecognizeFirstPass 15%
  Page: 1, Operation: RecognizeFirstPass 16%
  Page: 1, Operation: RecognizeFirstPass 17%
  Page: 1, Operation: RecognizeFirstPass 18%
  Page: 1, Operation: RecognizeFirstPass 19%
  Page: 1, Operation: RecognizeFirstPass 20%
  Page: 1, Operation: RecognizeFirstPass 21%
  Page: 1, Operation: RecognizeFirstPass 22%
  Page: 1, Operation: RecognizeFirstPass 23%
  Page: 1, Operation: RecognizeFirstPass 25%
  Page: 1, Operation: RecognizeFirstPass 26%
  Page: 1, Operation: RecognizeFirstPass 27%
  Page: 1, Operation: RecognizeFirstPass 29%
  Page: 1, Operation: RecognizeFirstPass 30%
  Page: 1, Operation: RecognizeFirstPass 32%
  Page: 1, Operation: RecognizeFirstPass 34%
  Page: 1, Operation: RecognizeFirstPass 35%
  Page: 1, Operation: RecognizeFirstPass 36%
  Page: 1, Operation: RecognizeFirstPass 38%
  Page: 1, Operation: RecognizeFirstPass 39%
  Page: 1, Operation: RecognizeFirstPass 40%
  Page: 1, Operation: RecognizeFirstPass 42%
  Page: 1, Operation: RecognizeFirstPass 43%
  Page: 1, Operation: RecognizeFirstPass 45%
  Page: 1, Operation: RecognizeFirstPass 46%
  Page: 1, Operation: RecognizeFirstPass 47%
  Page: 1, Operation: RecognizeFirstPass 48%
  Page: 1, Operation: RecognizeFirstPass 49%
  Page: 1, Operation: RecognizeFirstPass 50%
  Page: 1, Operation: RecognizeFirstPass 51%
  Page: 1, Operation: RecognizeFirstPass 52%
  Page: 1, Operation: RecognizeFirstPass 53%
  Page: 1, Operation: RecognizeFirstPass 54%
  Page: 1, Operation: RecognizeFirstPass 56%
  Page: 1, Operation: RecognizeFirstPass 57%
  Page: 1, Operation: RecognizeFirstPass 58%
  Page: 1, Operation: RecognizeFirstPass 59%
  Page: 1, Operation: RecognizeFirstPass 60%
  Page: 1, Operation: RecognizeFirstPass 61%
  Page: 1, Operation: RecognizeFirstPass 62%
  Page: 1, Operation: RecognizeFirstPass 63%
  Page: 1, Operation: RecognizeFirstPass 64%
  Page: 1, Operation: RecognizeFirstPass 65%
  Page: 1, Operation: RecognizeFirstPass 66%
  Page: 1, Operation: RecognizeFirstPass 67%
  Page: 1, Operation: RecognizeFirstPass 68%
  Page: 1, Operation: RecognizeFirstPass 69%
  Page: 1, Operation: RecognizeFirstPass 70%
  Page: 1, Operation: RecognizeFirstPass 71%
  Page: 1, Operation: RecognizeFirstPass 72%
  Page: 1, Operation: RecognizeFirstPass 73%
  Page: 1, Operation: RecognizeFirstPass 74%
  Page: 1, Operation: RecognizeFirstPass 75%
  Page: 1, Operation: RecognizeFirstPass 76%
  Page: 1, Operation: RecognizeFirstPass 77%
  Page: 1, Operation: RecognizeFirstPass 78%
  Page: 1, Operation: RecognizeFirstPass 79%
  Page: 1, Operation: RecognizeFirstPass 81%
  Page: 1, Operation: RecognizeFirstPass 82%
  Page: 1, Operation: RecognizeFirstPass 83%
  Page: 1, Operation: RecognizeFirstPass 84%
  Page: 1, Operation: RecognizeFirstPass 85%
  Page: 1, Operation: RecognizeFirstPass 86%
  Page: 1, Operation: RecognizeFirstPass 87%
  Page: 1, Operation: RecognizeFirstPass 88%
  Page: 1, Operation: RecognizeFirstPass 89%
  Page: 1, Operation: RecognizeFirstPass 90%
  Page: 1, Operation: RecognizeFirstPass 91%
  Page: 1, Operation: RecognizeFirstPass 92%
  Page: 1, Operation: RecognizeFirstPass 93%
  Page: 1, Operation: RecognizeFirstPass 94%
  Page: 1, Operation: RecognizeFirstPass 95%
  Page: 1, Operation: RecognizeFirstPass 96%
END
Finished successfully
====
Leadtools ~ 18,0,0,43 [2014-02-16 08:52]
Leadtools.Annotations ~ 18.0.0.7 [2014-02-04 14:40]
Leadtools.Codecs ~ 18,0,0,29 [2014-02-16 09:42]
Leadtools.Codecs.Bmp ~ 18,0,0,1 [2014-01-06 09:01]
Leadtools.Codecs.Cmp ~ 18,0,0,12 [2014-01-06 10:01]
Leadtools.Codecs.Fax ~ 18,0,0,4 [2014-01-06 09:58]
Leadtools.Codecs.Jb2 ~ 18,0,0,1 [2014-01-06 09:47]
Leadtools.Codecs.Jbg ~ 18,0,0,2 [2014-01-06 09:48]
Leadtools.Codecs.Tif ~ 18,0,0,11 [2014-02-04 19:38]
Leadtools.Forms ~ 18.0.0.3 [2014-01-07 11:13]
Leadtools.Forms.DocumentWriters ~ 18,0,0,21 [2014-02-05 14:37]
Leadtools.Forms.Ocr ~ 18.0.0.7 [2014-01-15 09:40]
Leadtools.Forms.Ocr.Advantage ~ 18,0,0,106 [2014-01-26 11:50]
Leadtools.Forms.SpellChecker.Native ~ 18.0.0.1 [2014-01-07 14:07]
Leadtools.ImageProcessing.Color ~ 18,0,0,2 [2014-01-06 10:42]
Leadtools.ImageProcessing.Core ~ 18,0,0,15 [2014-01-25 18:39]
Leadtools.ImageProcessing.Effects ~ 18,0,0,3 [2014-01-06 10:45]
Leadtools.ImageProcessing.Utilities ~ 18,0,0,4 [2014-01-25 18:25]
Leadtools.Kernel.Annotations ~ 18,0,0,2 [2014-01-18 13:56]
Leadtools.Pdf ~ 18,0,0,30 [2014-02-05 15:29]
====
Press Enter to continue...

Please let me know if you're still having any issues after testing the project I uploaded.

Thanks,
Anthony Northrup
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.104 seconds.