THPDFPage.MoveTextPoint Method
HotPDF Delphi PDF Component Developer Guide loslab Logo

 

THPDFPage.MoveTextPoint

THPDFPage

 

 

Top  Previous  Next

Moves current text point.

 

Delphi syntax:

procedure MoveTextPoint ( X, Y: Single );

 

C++ syntax:

void __fastcall MoveTextPoint ( float X, float Y );

 

Description

Call MoveTextPoint to move start of the text line.

 

Code Example

program ShowText;
{$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 := '.\ShowText.pdf';           // Set PDF filename
        HPDF.BeginDoc;                               // Create PDF file

        HPDF.CurrentPage.SetFont( 'Times New Roman', [], 12 );  // Set current font
        HPDF.CurrentPage.BeginText;                             // Open text block
        HPDF.CurrentPage.MoveTextPoint( 20, 20 );               // Move text point to 20, 20
        HPDF.CurrentPage.ShowText( 'This' );                    // Show text
        HPDF.CurrentPage.SetTextRise( -5 );                     // Set text rise
        HPDF.CurrentPage.ShowText( 'text' );                    // Show text
        HPDF.CurrentPage.SetTextRise( 5 );                      // Set text rise
        HPDF.CurrentPage.ShowText( 'moves' );                   // Show text
        HPDF.CurrentPage.SetTextRise( 0 );                      // Set text rise
        HPDF.CurrentPage.ShowText( 'around' );                  // Show text
        HPDF.CurrentPage.EndText;                               // Close text block

        HPDF.EndDoc;                                            // Close PDF file
    finally
        HPDF.Free;
    end;
end.

 

 

Copyright©2007-2025 losLab.com