ImageEn, unit iexPdfiumCore |
|
TPdfObjectList.RemoveObject
Declaration
procedure RemoveObject(Index: Integer);
Description
Remove the object of the specified index from the PDF page.
Note: You must call
ApplyChanges before saving to apply object changes to the document
// 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;