Loaded Image Extraction

La extracción de imágenes cargadas permite a las aplicaciones enumerar los XObjects de imagen después de que LoadFromFile o LoadFromStream abra un PDF existente, inspeccionar sus metadatos y decodificar las imágenes soportadas en instancias TBitmap

Main APIs

Supported sources

Decode parameters and safety

Example

var
  Doc: THotPDF;
  Info: THPDFLoadedImageInfo;
  Bmp: TBitmap;
  I: Integer;
begin
  Doc := THotPDF.Create(nil);
  try
    Doc.LoadFromFile('input.pdf');
    for I := 0 to Doc.GetLoadedImageCount - 1 do
      if Doc.GetLoadedImageInfo(I, Info) and Info.Decodable then
      begin
        Bmp := Doc.ExtractLoadedImage(I);
        try
          if Assigned(Bmp) then
            Bmp.SaveToFile(Format('image-%d.bmp', [I]));
        finally
          Bmp.Free;
        end;
      end;
  finally
    Doc.Free;
  end;
end;

Related APIs