THotPDF.EndDoc Method

 

THotPDF.EndDoc

THotPDF

 

Top  Previous  Next

Closes the document.

 

Delphi syntax:

procedure EndDoc;

 

C++ syntax:

void __fastcall EndDoc ( void );

 

Description

EndDoc finalizes the current document, closes internal PDF objects, and writes the output file or stream.

 

During document finalization HotPDF closes the active page and writes the final page content stream. If detailed page-content diagnostics are needed for this stage, enable PAGECONTENT_DEBUG_FILE in HotPDF.inc. This creates PageContent_Debug.txt with page-content merge and stream-size trace data. The switch is disabled by default, so normal builds do not create this file.

 

General library debug logging is controlled separately by withDEBUG in HotPDF.inc, which writes HotPDF-Debug.log when enabled.

 

Code Example


HPDF := THotPDF.Create( nil );
try
  HPDF.FileName := '.\Output.pdf';
  HPDF.BeginDoc;   // Start PDF document creation
  HPDF.CurrentPage.TextOut( 100, 100, 0, 'Hello World!' );
  HPDF.EndDoc;     // Finish and save PDF document
finally
  HPDF.Free;
end;

 

See also: BeginDoc