Leptonica provides many different methods for creating Pix object. You can 
read from file, memory buffer, etc. So you may need to write your bitmap to 
such intermediate formats and read back as Pix.

pixRead
pixReadMem
pixReadMemPng

Check its API doc:

https://github.com/DanBloomberg/leptonica/blob/master/src/allheaders.h


On Thursday, June 8, 2017 at 8:55:04 AM UTC-5, Hari.K wrote:
>
> Hi There,
>
>     I sometimes receive an error - "Failed to create pix, this normally 
> occurs because the requested image size is too large, please check Standard 
> Error Output" when doing OCR on a bitmap image.
>
>
> Below highlighted line is where it's breaking for me - 
>
>  Bitmap bitmap;
> Spire.Pdf.PdfDocument document = new Spire.Pdf.PdfDocument(pdfPath);
>
>
>             for (int i = 0; i <= document.Pages.Count; i++)
>             {
>                 bitmap = (Bitmap)document.SaveAsImage(i, 
> PdfImageType.Bitmap, 200, 200); // where 200 is the DPI which I am 
> setting for a bitmap image
>                 ...................
>                 .................
>
>             }
>
> More details on what I am trying to do here:
> 1) Uploaded a PDF document which is of hardly 600KB
> 2) Iterate through each PDF page and convert it into a BitMap image
> 3) Then input this BitMap image to Tesseract for performing OCR
>
> Please note, I don't get this error often. Any ideas on why this error as 
> I do not receive this every time ?
>
> Looking forward for some inputs on this..
>
> Thanks in Advance,
> Hari
>
>
>

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/1c25db3e-3217-4bfd-9db8-3fce7e863045%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to