Skip to main content

TdxPDFDocument.BeginUpdate Method

Disables all document change notifications until the application calls an EndUpdate procedure.

Declaration

procedure BeginUpdate;

Remarks

A BeginUpdate call disables the OnChanged, OnLoaded, and OnUnloaded events. Ensure that an EndUpdate call follows every BeginUpdate procedure call, even if an exception occurs.

Example

The following code example deletes the first two pages from the Demo.pdf document file as a single action:

var
  ADocument: TdxPDFDocument;
begin
  ADocument := TdxPDFDocument.Create;
  try
    ADocument.LoadFromFile('Data\Demo.pdf');

    ADocument.BeginUpdate;
    try
      ADocument.Pages.Delete(0);
      ADocument.Pages.Delete(1);
    finally
      ADocument.EndUpdate;
    end;
    ADocument.SaveToFile('Data\Result.pdf');
  finally
    ADocument.Free;
  end;
See Also