HotPDF Vertical Text Sample

This example demonstrates how the HotPDF component generates Unicode vertical text.

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, HPDFDoc;

type
  TForm1 = class(TForm)
    Button1: TButton;
    HotPDF: THotPDF;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
{$R *.DFM}
// Delphi 7 cannot display Unicode characters correctly.
// You need Delphi 2007 or above to open this file.

procedure TForm1.Button1Click(Sender: TObject);
begin
  HotPDF.BeginDoc;
  HotPDF.FileName := 'VerticalText.pdf';

  HotPDF.CurrentPage.SetFont('Arial Unicode MS', [], 12, 0, False);  //Set horizontal text
  HotPDF.CurrentPage.UnicodeTextOut( 30, 10, 0, 'Horizontal Text Горизонтальный текст 横書き');  //Print horizontal text

  HotPDF.CurrentPage.SetFont('Arial Unicode MS', [], 12, 0, True);  //Set vertical text
  HotPDF.CurrentPage.UnicodeTextOut( 30, 40, 0, 'Vertical Text');   //Print vertical text
  HotPDF.CurrentPage.UnicodeTextOut( 70, 40, 0, 'Texto vertical');
  HotPDF.CurrentPage.UnicodeTextOut( 110, 40, 0, 'Vertikaler Text');
  HotPDF.CurrentPage.UnicodeTextOut( 150, 40, 0, 'Texte vertical');
  HotPDF.CurrentPage.UnicodeTextOut( 190, 40, 0, 'Вертикальный текст');
  HotPDF.CurrentPage.UnicodeTextOut( 230, 40, 0, 'Testo verticale');
  HotPDF.CurrentPage.UnicodeTextOut( 270, 40, 0, '垂直文本');
  HotPDF.CurrentPage.UnicodeTextOut( 310, 40, 0, '縦書きテキスト');
  HotPDF.CurrentPage.UnicodeTextOut( 350, 40, 0, 'Verticale tekst');
  HotPDF.CurrentPage.SetFont('Malgun Gothic Semilight', [], 12, 0, True);  //Set Korean Font
  HotPDF.CurrentPage.UnicodeTextOut( 390, 40, 0, '한국어 텍스트');
  HotPDF.EndDoc;
end;
end.

losLab

Devoted to developing PDF and Spreadsheet developer library, including PDF creation, PDF manipulation, PDF rendering library, and Excel Spreadsheet creation & manipulation library.