PDF->PDF with OCR->Reducing DPI

Discussions about machine vision support in GdPicture.
Post Reply
BennyCUAG
Posts: 6
Joined: Wed Mar 07, 2012 6:45 pm

PDF->PDF with OCR->Reducing DPI

Post by BennyCUAG » Thu Apr 18, 2013 3:24 pm

Hello,
we build searchable PDFs with the following function:

Code: Select all

            if (oGdPicturePDF.LoadFromFile(pFile, false) == GdPicture9.GdPictureStatus.OK)
            {
                
                pdfID = oGdPictureImaging.PdfOCRStart(pOcrFile, true, title, author, subject, keywords, creator);
                if (pdfID == 0)
                {
                    return false;
                }            

                for (int i = 1; i <= oGdPicturePDF.GetPageCount(); i++)
                {
                    oGdPicturePDF.SelectPage(i);
                    imageID = oGdPicturePDF.RenderPageToGdPictureImage(pResolution, true);
                    if (imageID == 0)
                    {
                        return false;
                    }

                    oGdPictureImaging.PdfAddGdPictureImageToPdfOCR(pdfID, imageID, lang, directory, "");   
        	    oGdPictureImaging.ReleaseGdPictureImage(imageID);
       
                }
                oGdPicturePDF.CloseDocument();
		oGdPictureImaging.PdfOCRStop(pdfID); 
            }
            else
            {
                return false;
            }
..it works fine. At the moment we use for "pResolution" 200dpi, which creates very big pdf files (original file 200kb -> new file 2mb). Is there a chance to reduce the size (the picture dpi) after creating the ocr-pdf file?

Maybe there is an easier way to create an ocr-pdf from a normal pdf?

greetings


Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest