HotPDF Delphi PDF Component Developer Guide loslab Logo

 

THPDFPage.LineTo

THPDFPage

 

Top  Previous  Next

Draws line.

 

Delphi syntax:

procedure LineTo ( X, Y: Single );

 

C++ syntax:

void __fastcall LineTo ( float X, float Y );

 

Description

Append a straight line segment from the current point to the point X, Y. The new current point is X, Y.

 

Code Example

program LineExample;
{$APPTYPE CONSOLE}
uses
    SysUtils, Graphics, Classes, HPDFDoc;
var
    HPDF: THotPDF;
begin
    HPDF := THotPDF.Create(nil);
    try
        HPDF.AutoLaunch := true;                   // PDF file will be shown automatically
        HPDF.FileName := '.\Line.pdf';             // Set PDF filename
        HPDF.BeginDoc;                             // Create PDF file
        HPDF.CurrentPage.MoveTo ( 20, 20 );        // Move current point to 20, 20 
        HPDF.CurrentPage.LineTo (  200, 100 );     // Draw line from current point to 200, 100
        HPDF.CurrentPage.Stroke;                   // and stroke
        HPDF.EndDoc;                               // Close PDF file
    finally
        HPDF.Free;
    end;
end.
Copyright©2007-2025 losLab.com