THotPDF.CreateParagraph Méthode

 

THotPDF.CreateParagraph

THotPDF

 

Haut  Précédent  Suivant

Creates new paragraph for PDF document.

 

Syntaxe Delphi :

  function CreateParagraph ( Indention: Single; Justification: THPDFJustificationType; LeftMargin, RightMargin: Single ): Integer;

 

Syntaxe C++ :

int __fastcall CreateParagraph(float Indention, THPDFJustificationType Justification, float LeftMargin,

                                          float RightMargin, float TopMargin, float BottomMargin);

 

Description

Appelez la fonction CreateParagraph pour ajouter un nouveau paragraphe au document PDF. Indention, LeftMargin et RightMargin déterminent les réglages du paragraphe ( voir  l’image ci-dessous ), Justification détermine la justification par défaut du paragraphe. La fonction CreateParagraph renvoie le numéro interne du nouveau paragraphe.

 

Paragraph margins diagram

 

Exemple de code


HPDF.CurrentParagraph.Justification := hjLeft;
HPDF.CurrentParagraph.ShowText( 'Text aligned to the left' );
HPDF.CurrentParagraph.NewLine;

HPDF.CurrentParagraph.Justification := hjCenter;
HPDF.CurrentParagraph.ShowText( 'Text aligned in the center' );
HPDF.CurrentParagraph.NewLine;

HPDF.CurrentParagraph.Justification := hjRight;
HPDF.CurrentParagraph.ShowText( 'Text aligned to the right' );
HPDF.CurrentParagraph.NewLine;

HPDF.CurrentParagraph.Justification := hjJustify;
HPDF.CurrentParagraph.ShowText( 'Text is fully justified. This means that spaces between words are adjusted to make the text fill the entire line from margin to margin.' );

 

Voir aussi: BeginParagraph,  EndParagraph, ParaAutoAddPage