ImageEn, unit iexPdfiumCore

TPdfObjectList.RemoveObject

TPdfObjectList.RemoveObject


Declaration

procedure RemoveObject(Index: Integer);


Description

Remove the object of the specified index from the PDF page.


Examples

// Remove the highlighted object from the PDF page
ImageEnView1.PdfViewer.Objects.RemoveObject( ImageEnView1.PdfViewer.Objects.HighlightedIndex );

// Delete the item clicked on
procedure TfrmMain.ImageEnView1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
  idx: Integer;
  pt: TDPoint;
begin
  pt := ImageEnView1.PdfViewer.ScrToPage( X, Y, True );
  idx := ImageEnView1.PdfViewer.Objects.FindObjectAt( pt );
  if idx > -1 then
    if MessageDlg( format( 'Delete object %d?', [ idx + 1 ]), mtConfirmation, [ mbYes,mbNo ], 0 ) = mrYes then
      ImageEnView1.PdfViewer.Objects.RemoveObject( idx );
end;