|
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; // Cria o arquivo PDF ParaIndex1 := HPDF.CreateParagraph( 20, jtLeft, 60, 60, 30, 30 ); // Cria o parágrafo principal ParaIndex2 := HPDF.CreateParagraph( 20, jtLeft, 60, 60, 90, 30 ); // Cria o parágrafo estreito HPDF.ParaAutoAddPage := true; // O parágrafo adicionará páginas automaticamente HPDF.BeginParagraph(ParaIndex1); // Abre o parágrafo principal HPDF.CurrentPage.SetFont('Arial', [fsBold], 14 ); // Define a fonte do parágrafo HPDF.CurrentParagraph.Justification := jtCenter; // Define a justificação do parágrafo HPDF.CurrentPage.SetRGBFillColor(clGray); HPDF.CurrentParagraph.ShowText('VCL component for Delphi for creating PDF documents.'); // Imprime o texto do parágrafo HPDF.CurrentPage.SetRGBFillColor(clBlack); HPDF.EndParagraph; HPDF.BeginParagraph(ParaIndex2); // Abre o parágrafo estreito HPDF.CurrentPage.SetFont('Arial', [], 14 ); // Define a fonte do parágrafo 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; // Obtém a linha de impressão atual HPDF.EndParagraph; // Fecha o parágrafo HPDF.EndDoc; // Fecha o arquivo PDF finally HPDF.Free; end; end. |