get Filesize during building up a OCR-PDF
get Filesize during building up a OCR-PDF
Hi,
with multiple TIF files I'm generate a OCR PDF with "PdfAddGdPictureImageToPdfOCR". Everthing works fine.
One condition is that no file has to become bigger then 10MB. Therefore I always have to know what is the actual filesize of the PDF. If the limit of 10MB is reached, I create a new PDF (01, 02, 03...)
Is there any property which I can use to get the file length or where can I find the temporary PDF?
Thanks Olaf
with multiple TIF files I'm generate a OCR PDF with "PdfAddGdPictureImageToPdfOCR". Everthing works fine.
One condition is that no file has to become bigger then 10MB. Therefore I always have to know what is the actual filesize of the PDF. If the limit of 10MB is reached, I create a new PDF (01, 02, 03...)
Is there any property which I can use to get the file length or where can I find the temporary PDF?
Thanks Olaf
Re: get Filesize during building up a OCR-PDF
Hello Olaf,
The only way is to save the current PDF into a memory stream and get the stream size.
Kind regards,
Loïc
The only way is to save the current PDF into a memory stream and get the stream size.
Kind regards,
Loïc
Re: get Filesize during building up a OCR-PDF
Hello Loïc,
thanks a lot for fast response.
Stream... OK. But how can I save the hole PDF to a stream? I set the jpg quality to a low level. Therefore a have to know the size of the hole pdf and not the sum of all the images.
I only find the possibility to save one image to a stream, not for a PDF.
maybe you have an example for me?
Thanks Olaf
thanks a lot for fast response.
Stream... OK. But how can I save the hole PDF to a stream? I set the jpg quality to a low level. Therefore a have to know the size of the hole pdf and not the sum of all the images.
I only find the possibility to save one image to a stream, not for a PDF.
maybe you have an example for me?
Thanks Olaf
Re: get Filesize during building up a OCR-PDF
Maybe at least a short hint?
Can i Use gdpicture to save the stream or have I to use system.io? In gdpicture I only find methods to save ONE Image...
Can i Use gdpicture to save the stream or have I to use system.io? In gdpicture I only find methods to save ONE Image...
Re: get Filesize during building up a OCR-PDF
Hi Loïc,
I realised, that I have posted in the wrong topic. Maybe you can move this thread in the topic "GdPicture Tesseract OCR Engine Plugin". Maybe someone else than help me.
I realised, that I have posted in the wrong topic. Maybe you can move this thread in the topic "GdPicture Tesseract OCR Engine Plugin". Maybe someone else than help me.
Re: get Filesize during building up a OCR-PDF
Hello Olaf,
After further investigations I realized that it was not really accurate way to anticipate the actual PDF size.
The only workaround I can see is:
- Create one PDF/OCR by page.
- With the GdPicturePDF class, merge a number of created files to do not exceed your limitation.
This looks a little messy but unfortunately I have no other workaround in mind.
Kind regards,
Loïc
After further investigations I realized that it was not really accurate way to anticipate the actual PDF size.
The only workaround I can see is:
- Create one PDF/OCR by page.
- With the GdPicturePDF class, merge a number of created files to do not exceed your limitation.
This looks a little messy but unfortunately I have no other workaround in mind.
Kind regards,
Loïc
Who is online
Users browsing this forum: No registered users and 0 guests