Clear
IPDFDocument4 :: General document management :: Common

See Also Example
Collapse All

This method clears all internal data and stops the generation of the PDF document.

Syntax

HRESULT Clear ()
Return value
If successful, this method returns S_OK. If it fails, this method should return one of the error values.

Example

Aborting PDF File Creation

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
{ some method calls etc. }
{ let variable 'errorOccurred' contain value indicating if error occurred }

if errorOccurred then
   PDF.Clear
else
   PDF.SaveToFile("test.pdf", true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
// some method calls etc.
// let variable 'errorOccurred' contain value indicating if error occurred

if (errorOccurred)
   PDF->Clear();
else
   PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
// some method calls etc.
// let variable 'errorOccurred' contain value indicating if error occurred

if (errorOccurred)
   PDF.Clear();
else
   PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
'some method calls etc.
' let variable "errorOccurred" contain value indicating if error occurred

if errorOccurred Then
   PDF.Clear
else
   PDF.SaveToFile "test.pdf", true
end if
Set PDF = nothing

See Also

Reference