Hi
Actually with the new compression support we have added for PDFium in v14.0.1, this should now be possible without downgrading the content to images.
// Reduce the size of the PDF file by lowering the quality of the images and enabling JPEG compression (B is a TIEBitmap)
ImageEnView1.IOParams.PDF_Compression := ioPDF_JPEG;
ImageEnView1.IOParams.JPEG_Quality := 75;
for i := 0 to ImageEnView1.PdfViewer.Objects.Count - 1 do
begin
oPDF := ImageEnView1.PdfViewer.Objects[i];
if (oPDF.ObjectType = ptImage) then
begin
B := TIEBitmap.Create();
try
if oPDF.GetImage( B ) then
begin
B.Resample( 0.5 );
oPDF.SetImage(B);
end;
finally
B.Free;
end;
end;
end;
ImageEnView1.PdfViewer.ReloadPage();
https://www.imageen.com/help/TPdfObject.SetImage.html
Nigel
Xequte Software
www.imageen.com