PDFium Delphi Component Docs

ObjectBitmap property

Component: TPdf  ·  Unit: PDFium
Indexed property — returns one image page object as a renderable VCL TBitmap (lossy decoded from JPX/CCITT/etc.)

Syntax

property ObjectBitmap[Index: Integer]: TBitmap; // read only

Description

Indexed read-only property returning the page object at Index as a freshly allocated VCL/LCL TBitmap when ObjectType[Index] = otImage, or nil for non-image page objects

Needs Active to be True. Valid indexes are 0 .. ObjectCount - 1 (for image-only indexing in 0 .. BitmapCount - 1, use Bitmap[Index] instead)

The caller owns the returned TBitmap and must Free it when finished

Parameters

IndexZero-based index in the range 0 .. ObjectCount - 1

Remarks

Example

var
  I: Integer;
  Bmp: TBitmap;
begin
  if not Pdf1.Active then Exit;
  for I := 0 to Pdf1.ObjectCount - 1 do
    if Pdf1.ObjectType[I] = otImage then
    begin
      Bmp := Pdf1.ObjectBitmap[I];
      try
        if Assigned(Bmp) then
          Memo1.Lines.Add(Format('Object %d: %dx%d', [I, Bmp.Width, Bmp.Height]));
      finally
        Bmp.Free;
      end;
    end;
end;

See Also

BitmapCount, Image, ImageCount