Hi Nigel,
I am using ImageEn 13.1.0 and IEVision 8.1.0 with Delphi 12 Athens.
I modified the GenerateSearchablePDF demo to apply the JPG compression and remove any alpha channel, as follows, but the resulting PDF is still about 10 meg. per page:
// generate PDF
pdfGen := IEVisionLib.createSearchablePDFGenerator(PAnsiChar(AnsiString(langPath)), PAnsiChar(AnsiString(langCode)) );
pdfGen.setSegmentationMode(TIEVisionOCRPageSegmentationMode(cmbLayout.ItemIndex));
pdfGen.beginDocument(PAnsiChar(AnsiString( outFile )), PAnsiChar(AnsiString( 'IEVision PDF Test' )));
for i := 0 to ImageEnMView1.ImageCount - 1 do
begin
ProgressBar1.Position := MulDiv( i, 100, ImageEnMView1.ImageCount );
ProgressBar1.Visible := True;
ImageEnMView1.SelectedImage := i;
Application.ProcessMessages();
ImageEnMView1.IEBitmap.ParamsEnabled := true;
ImageEnMView1.IEBitmap.Params.Dpi := ImageEnMView1.MIO.Params[i].Dpi;
// added to set compression and remove alpha channel from JPEG images
if ( CompareText( ExtractFileExt( ImageEnMView1.MIO.Params[i].FileName ), '.jpg' ) = 0 )
or ( CompareText( ExtractFileExt( ImageEnMView1.MIO.Params[i].FileName ), '.jpeg' ) = 0 ) then
begin
ImageEnMView1.IEBitmap.Params.PDF_Compression := ioPDF_JPEG;
ImageEnMView1.IEBitmap.Params.JPEG_Quality := 90;
if ImageEnMView1.IEBitmap.HasAlphaChannel() then
ImageEnMView1.IEBitmap.RemoveAlphaChannel( true );
ImageEnMView1.Update;
end;
//
pdfGen.addPage(ImageEnMView1.IEBitmap.GetIEVisionImage());
end;
pdfGen.endDocument();
pdfGen := nil;
Is there something I'm missing?
Thanks
Kevin McB