Zdenko
Thank you very much for your support,I can run with VS successfuly your
sample,my solution was to run :vcpkg integrate install
Am Freitag, 25. Oktober 2019 16:35:14 UTC+2 schrieb Ivica Anic:
>
> Hi,
> I am testing the Tesseract C++ API (4.1 Version).
> Here is my code:
>
>
> char *datapath = "C:\\Temp\\tessdata-master";
> string language_ = "deu";
> string inputFile_ = "./input.png";
> tesseract::TessBaseAPI *api100 = new tesseract::TessBaseAPI();
> if (api100->Init(datapath, "deu", tesseract::OEM_LSTM_ONLY)) {
> fprintf(stderr, "Could not initialize tesseract.\n");
> exit(1);
> }
>
>
> api100->SetVariable("tessedit_create_pdf", "T");
> //png File is input file
> PIX *sourceImg100 = pixRead(inputImage.c_str());
>
> api100->SetImage(sourceImg100);
>
>
> api100->Recognize(0);
>
> api100->SetPageSegMode(tesseract::PSM_AUTO_ONLY);
> api100->SetInputName(inputImage.c_str());
> tesseract::TessResultRenderer *renderer100 = new
> tesseract::TessPDFRenderer("output_base", api100->GetDatapath(),false);
>
> renderer100->BeginDocument("test");
> renderer100->AddImage(api100);
> api100->ProcessPage(sourceImg100, 0, inputImage.c_str(), NULL, 5000,
> renderer100);
> renderer100->EndDocument();
> api100->End();
> pixDestroy(&sourceImg100);
>
> how can I get a searchable PDF file output and save it on my
> computer ?
> I mean, exactly like the command line : tesseract test.tif output
> pdf
>
> Zdenko:
> by my test one output pdf File is created,but pdf file is not
> readable
> if I try to open pdf File it is comming Error XREF-Data in pdf-file
> are missing
>
>
>
>
> Thanks a lot
>
--
You received this message because you are subscribed to the Google Groups
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tesseract-ocr/db169920-7ce3-4963-9ec3-83d28c1f6dc6%40googlegroups.com.