|
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; // Vytvořit soubor PDF ParaIndex1 := HPDF.CreateParagraph( 20, jtLeft, 60, 60, 30, 30 ); // Vytvořit hlavní odstavec ParaIndex2 := HPDF.CreateParagraph( 20, jtLeft, 60, 60, 90, 30 ); // Vytvořit úzký odstavec HPDF.ParaAutoAddPage := true; // Odstavec bude stránky přidávat automaticky HPDF.BeginParagraph(ParaIndex1); // Otevřít hlavní odstavec HPDF.CurrentPage.SetFont('Arial', [fsBold], 14 ); // Nastavit písmo odstavce HPDF.CurrentParagraph.Justification := jtCenter; // Nastavit zarovnání odstavce HPDF.CurrentPage.SetRGBFillColor(clGray); HPDF.CurrentParagraph.ShowText('VCL component for Delphi for creating PDF documents.'); // Vytisknout odstavec text HPDF.CurrentPage.SetRGBFillColor(clBlack); HPDF.EndParagraph; HPDF.BeginParagraph(ParaIndex2); // Otevřít úzký odstavec HPDF.CurrentPage.SetFont('Arial', [], 14 ); // Nastavit písmo odstavce 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; // Zavřít odstavec HPDF.EndDoc; // Zavřít soubor PDF finally HPDF.Free; end; end. |