Page 1 of 1

PDF->PDF with OCR->Reducing DPI

Posted: Thu Apr 18, 2013 3:24 pm
by BennyCUAG
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

Re: PDF->PDF with OCR->Reducing DPI

Posted: Wed Jan 30, 2019 5:56 pm
by Gabriela