|
program ParaDemo; {$APPTYPE CONSOLE} uses Graphics, SysUtils, HPDFDoc; var HPDF: THotPDF; CurrntParaLine: Single; ParaIndex1: Integer; ParaIndex2: Integer; begin HPDF := THotPDF.Create(nil); try HPDF.FileName := 'ParaDemo.pdf'; HPDF.BeginDoc; // Створення файлу PDF ParaIndex1 := HPDF.CreateParagraph( 20, jtLeft, 60, 60, 30, 30 ); // Створення головного абзацу ParaIndex2 := HPDF.CreateParagraph( 20, jtLeft, 60, 60, 90, 30 ); // Створення вузького абзацу HPDF.ParaAutoAddPage := true; // Абзац автоматично додаватиме сторінки HPDF.BeginParagraph(ParaIndex1); // Відкриття головного абзацу HPDF.CurrentPage.SetFont('Arial', [fsBold], 14 ); // Встановлення шрифту абзацу HPDF.CurrentParagraph.Justification := jtCenter; // Встановлення вирівнювання абзацу HPDF.CurrentPage.SetRGBFillColor(clGray); HPDF.CurrentParagraph.ShowText('VCL component for Delphi for creating PDF documents.'); // Print paragraph text HPDF.CurrentPage.SetRGBFillColor(clBlack); HPDF.EndParagraph; HPDF.BeginParagraph(ParaIndex2); // Відкриття вузького абзацу HPDF.CurrentPage.SetFont('Arial', [], 14 ); // Встановлення шрифту абзацу HPDF.CurrentParagraph.ShowText('HotPDF is PDF Creation Library for Delphi & C++Builder. HotPDF does not use any DLL or other software to create PDF files. The HotPDF distribution includes the complete help system and many demo programs'); HPDF.CurrentParagraph.ShowText(': PDF load and edit examples,PDF console application samples,PDF GUI application samples,server PDF application sample etc.'); CurrntParaLine := HPDF.CurrentParagraph.CurrentLine; //Get current print line HPDF.EndParagraph; // Закриття абзацу HPDF.EndDoc; // Закриття файлу PDF finally HPDF.Free; end; end. |