Rank: Newbie
Groups: Registered
Joined: 3/15/2017(UTC) Posts: 2  Thanks: 1 times
|
I have been successfully converting colour tiffs with lzw compression to searchable pdf however tiffs with jpeg compression do not seem to be passed to the ocr engine. could you please advise?
Thanks.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
Could you please provide the tiff file?
|
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 3/15/2017(UTC) Posts: 2  Thanks: 1 times
|
 1_JPEG.tif (863kb) downloaded 28 time(s). 1_LZW.tif (3,965kb) downloaded 29 time(s).Hi Paul, Thanks for you assistance. PFA two TIF files in with JPEG and LZW compression. The LZW conversion works OK yet the JPEG TIF will not pass to the engine. Thanks.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
well...unfortunately there is a problem with the old-style jpeg encoded tiff files. But I can suggest the following workaround Code:
using (var api = OcrApi.Create())
{
api.Init(Languages.English);
using (var renderer = OcrPdfRenderer.Create(@"D:\4\output_pdf", @"tessdata"))
{
renderer.BeginDocument("Title");
var image = Image.FromFile(@"D:\4\1_JPEG.tif");
var pages = image.GetFrameCount(FrameDimension.Page);
for (int index = 0; index < pages; index++)
{
image.SelectActiveFrame(FrameDimension.Page, index);
using (var bmp = new Bitmap(image.Width, image.Height))
{
using (var g = Graphics.FromImage(bmp))
{
g.DrawImage(image, 0, 0, image.Width, image.Height);
}
using (var pix = OcrPix.FromBitmap(bmp))
{
api.ProcessPage(pix, null, 0, renderer);
}
}
}
renderer.EndDocument();
}
}
Fixed!https://forum.patagames.com/posts/t431-Version-1-14-341-was-released-on-Feb-08--2018Edited by user Thursday, February 8, 2018 2:06:10 AM(UTC)
| Reason: Not specified
|
 1 user thanked Paul Rayman for this useful post.
|
|
|
|
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