EndPageUpdate
Page layout
Description
Closes the batched-drawing transaction that was opened by the most recent BeginPageUpdate call and flushes the buffered drawing operators to the current page's content stream. Every BeginPageUpdate call must be paired with exactly one EndPageUpdate call.
Syntax
Delphi
function TPDFlib.EndPageUpdate: Integer;ActiveX
Function PDFlib::EndPageUpdate As LongDLL
int DLEndPageUpdate(int InstanceID);Return values
| 0 | Failed — no document is open or no BeginPageUpdate transaction is currently active on the selected page. |
|---|---|
| 1 | The transaction was closed and the buffered content was committed to the page. |
Remarks
Calling EndPageUpdate without a matching BeginPageUpdate has no effect and returns 0. Forgetting to call EndPageUpdate after opening a transaction leaves the buffered drawing operators uncommitted; they will be lost when the document is saved.
Example
// Add a watermark on every page of an existing document
PDF.LoadFromFile('contract.pdf', '');
for I := 1 to PDF.GetPageCount do
begin
PDF.SelectPage(I);
PDF.BeginPageUpdate;
PDF.SetTextColor(0.85, 0.85, 0.85);
PDF.SetFontSize(72);
PDF.PrintText(100, 400, 'CONFIDENTIAL');
PDF.EndPageUpdate;
end;
PDF.SaveToFile('contract-confidential.pdf');See also
BeginPageUpdate, SelectPage, PageCount, EndPage