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

Notification

Icon
Error

Options
Go to last post Go to first unread
bert  
#1 Posted : Sunday, June 5, 2016 4:33:53 AM(UTC)
bert

Rank: Newbie

Groups: Registered
Joined: 6/5/2016(UTC)
Posts: 2
Australia

Thanks: 1 times
I'm evaluating this library for a project that searches the resulting text for various values. When I try to read the text of out the created PDF it's now saying there is no PDF Header. I realise this is probably a Tesseract issue but it there a way to tell the library to create a PDF containing a valid header?
Paul Rayman  
#2 Posted : Sunday, June 5, 2016 6:04:47 AM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
Do you use BeginDocument/EndDocument like in sample below?

Code:

using (var api = OcrApi.Create())
{
    api.Init(Languages.English);
    using (var renderer = OcrPdfRenderer.Create("multipage_pdf_file", "c:\\YourApp\\tessdata\\"))
    {
        renderer.BeginDocument("Title");
        api.ProcessPages(@"c:\multipage.tif", null, 0, renderer);
        renderer.EndDocument();
    }
}
thanks 1 user thanked Paul Rayman for this useful post.
bert on 6/5/2016(UTC)
bert  
#3 Posted : Sunday, June 5, 2016 5:41:13 PM(UTC)
bert

Rank: Newbie

Groups: Registered
Joined: 6/5/2016(UTC)
Posts: 2
Australia

Thanks: 1 times
Yes, I had used the example code pretty much as it. Turns out it was my mistake though and I wasn't actually looking a the correct version of the created file. Thanks for the quick response though.
Users browsing this topic
Guest
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.