Skip to content

PDF creation not working #430

Description

@elpendor

Hi, I'm having some problems generating a PDF with the library.

When I call recognizedPDFForImages I get:

Error in fopenWriteStream: stream not opened
Error in pixWrite: stream not opened
Error in fopenReadStream: file not found
Error in extractG4DataFromFile: stream not opened to file
Error in l_generateG4Data: datacomp not extracted
Error in pixGenerateCIData: g4 data not made

This seems to be coming from the line:

result = _tesseract->ProcessPage(pix, page, pagename, NULL, 0, renderer);

I understand this is originating from Leptonica and not Tesseract but I'm having some trouble figuring it out. I guess its related to reading/writing the output file, maybe? Seems to be be reading the input image fine.

Regular OCR using recognizedText seems to be working just fine.

Tried several images (the one from the repo included), tried both jpg and png. Same result.
Also pdf.ttf is inside tessdata folder (just in case, even though it shouldn't be necessary).

I'm running the exact code from the tests, and the app is targeting 14.0, if it's of any help.

Any ideas?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions