Rank: Newbie
Groups: Registered
Joined: 3/8/2016(UTC) Posts: 1 
|
I'm processing multi-page tif files, creating multi-page pdf output. I need to get the hOcr output as well. The ocr'd pdf output is being created as expected, but the hOcr output is only giving me the last page of the source file. I've tried a number of approaches.. In this two-page processing example, I get the second page output twice in the hOcr file: Code:using (var api = OcrApi.Create())
{
api.Init(Languages.English);
using (var renderer = OcrPdfRenderer.Create(outputBase, TessDataDirectory))
{
renderer.BeginDocument(string.Empty);
api.ProcessPages(tifFilePath, null, 0, renderer);
renderer.EndDocument();
var hOcrResult = new StringBuilder();
for (int i = 0; i < DirectoryUtils.PdfPagecount; i++)
{
hOcrResult.Append(api.GetHOCRText(i));
}
File.WriteAllText(string.Format("{0}.html", outputBase), hOcrResult.ToString());
}
}
Is there another technique I should be using with the GetHOCRText method, or maybe another approach entirely? Thanks.
|
|
|
|
|
|
Rank: Guest
Groups: Guests
Joined: 1/5/2016(UTC) Posts: 162
Was thanked: 5 time(s) in 5 post(s)
|
|
|
|
|
|
|
Forum Jump
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.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close