Delphi 5 TDateTimePicker Format

Delphi 5 TDateTimePicker Format

During add Delphi 5 compatibility to the Purchase Order calculation sample of HotXLS Delphi Excel Spreadsheet component, an error occurred while compiling under Delphi 5. The line which set the date format of the TDateTimePicker control does not compile: DateTimePicker.Format := ‘MM/dd/yyyy’; TDateTimePicker control of Delphi is a wrapper around a Microsoft control. It allows you to show the date in one of two formats (long and short), but in Delphi 5 and lower, it did not allow you to…

Read More Read More

ftol and the 64bit Delphi inline asm changes

ftol and the 64bit Delphi inline asm changes

function _ftol( f: double) : Integer; cdecl; begin asm lea eax, f fstp qword ptr [eax] end; result := Trunc(f); end; Above is a Delphi inline asm version of the ftol (Floating Point to Integer Conversion) function used by our HotPDF Delphi PDF component. When compiling above Delphi codes in the 64-bit target platform, Delphi will raise below error: [dcc64 Error] E1025 Unsupported language feature: ‘ASM’ The reason is: The 64-bit Delphi compiler DCC64 does not support mixed Pascal/assembly code….

Read More Read More

Delphi Incompatible type tagLOGBRUSH tagLOGBRUSH32

Delphi Incompatible type tagLOGBRUSH tagLOGBRUSH32

When using Delphi XE2 or above editions to compile coeds likes below: procedure VEMRCREATEBRUSHINDIRECT(Data: PEMRCreateBrushIndirect); begin GDIObjects[Data^.ihBrush] := CreateBrushIndirect(Data^.lb); //GDIObjects and CreateBrushIndirect are defined in the winapi.windows unit. end; The compiler says: E2010 Incompatible types: ‘tagLOGBRUSH’ and ‘tagLOGBRUSH32’. The solution to fix this compiling error is: procedure VEMRCREATEBRUSHINDIRECT(Data: PEMRCreateBrushIndirect); var LogBrush: TLogBrush; begin LogBrush.lbStyle := Data^.lb.lbStyle; LogBrush.lbColor := Data^.lb.lbColor; LogBrush.lbHatch := Data^.lb.lbHatch; GDIObjects[Data^.ihBrush] := CreateBrushIndirect(LogBrush); end;

C++Builder dynamic create & delete HotPDF component instance

C++Builder dynamic create & delete HotPDF component instance

This example shows you how to programmatically New and Free a HotPDF object instance with C++Builder. #include #pragma hdrstop #include “Unit1.h” //————————————————————————— #pragma package(smart_init) #pragma link “HPDFDoc” #pragma resource “*.dfm” TForm1 *Form1; //————————————————————————— __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //————————————————————————— void __fastcall TForm1::Button1Click(TObject *Sender) { THotPDF* HotPDF1 = new THotPDF(this); HotPDF1->FileName = “HelloWorld.pdf”; HotPDF1->AutoLaunch = true; HotPDF1->BeginDoc(false); HotPDF1->CurrentPage->PrintText( 10, 10, 0, “Hello World!” ); HotPDF1->EndDoc(); HotPDF1->Free(); } You need to set the include & library path of the project…

Read More Read More

HotPDF Canvas Draw

HotPDF Canvas Draw

This HotPDF Component Sample draw plots with Delphi TCanvas. program CanvasDraw; {$APPTYPE CONSOLE} uses {$IFDEF VER230} System.SysUtils, System.Classes, Vcl.Graphics, {$ELSE} SysUtils, Classes, Graphics, {$ENDIF} HPDFDoc; var I, Y: Integer; HotPDF: THotPDF; begin HotPDF:= THotPDF.Create(nil); try Randomize; HotPDF.AutoLaunch := true; HotPDF.FileName := ‘CanvasDraw.pdf’; HotPDF.BeginDoc; // Create PDF file HotPDF.Canvas.Font.Size := 14; // Set canvas font size I :=20; Y := 60; HotPDF.Canvas.TextOut(10, 30, ‘Canvas Rectangles’); // Print text while I

HotPDF Table To PDF

HotPDF Table To PDF

HotPDF Component Database Table To PDF sample program TableDemo; {$APPTYPE CONSOLE} { Reduce EXE size by disabling as much of RTTI as possible } {$IFDEF VER210} {$WEAKLINKRTTI ON} {$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])} {$ENDIF} uses {$IFDEF VER230}System.Classes, System.SysUtils, Vcl.Graphics, DB, DBTables, {$ELSE} Classes, SysUtils, Graphics, DB, DBTables, {$ENDIF} HPDFDoc; var HotPDF: THotPDF; PageNum, VertPos: Integer; CustomerTable: TTable; Back: boolean; procedure PrintRow(Position: Integer; No, Company, Addr, City: AnsiString; ShowBackground: boolean); begin if ShowBackground then begin HotPDF.CurrentPage.SetRGBColor($FFF3DD); HotPDF.CurrentPage.Rectangle(50, Position, 520, 20); HotPDF.CurrentPage.Fill;…

Read More Read More

HotPDF Chart Sample

HotPDF Chart Sample

This HotPDF Component example show charts in PDF document using TeeChart. unit ChartUnit; interface uses {$IF CompilerVersion >= 16} Winapi.Windows, Winapi.Messages, System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, VclTee.TeeGDIPlus, VclTee.TeEngine, VclTee.Series, VclTee.TeeProcs, VclTee.Chart, {$ELSE}Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, TeEngine, Series, TeeProcs, Chart, {$ENDIF} HPDFDoc; type TForm1 = class(TForm) RadioGroup1: TRadioGroup; DemoChart: TChart; BarSeries1: TBarSeries; BarSeries2: TBarSeries; BarSeries3: TBarSeries; Panel1: TPanel; Label1: TLabel; RadioGroup2: TRadioGroup; ComboBox1: TComboBox; Button1: TButton; procedure RadioGroup1Click(Sender: TObject); procedure FormCreate(Sender: TObject);…

Read More Read More

HotPDF Barcode Sample

HotPDF Barcode Sample

This HotPDF Component example generates barcode within PDF for 22 popular types. program Barcodes; {$APPTYPE CONSOLE} uses {$IFDEF VER230} System.Classes, System.SysUtils, Vcl.Graphics, {$ELSE} Classes, SysUtils, Graphics, {$ENDIF} HPDFDoc; var I, H: Integer; HotPDF: THotPDF; const Names: array[0..21] of string = ( ‘Code 25 Interleaved’, ‘Code 25 Industrial’, ‘Code 25 Matrix’, ‘Code39’, ‘Code39 Extended’, ‘Code128A’, ‘Code128B’, ‘Code128C’, ‘Code93’, ‘Code93 Extended’, ‘MSI’, ‘PostNet’, ‘Codebar’, ‘EAN8’, ‘EAN13’, ‘UPC_A’, ‘UPC_E0’, ‘UPC_E1’, ‘UPC Supp2’, ‘UPC Supp5’, ‘EAN128A’, ‘EAN128B’ ); begin HotPDF:= THotPDF.Create(nil); try HotPDF.AutoLaunch :=…

Read More Read More

HotPDF Hyperlink Sample

HotPDF Hyperlink Sample

This HotPDF Component Sample adds clickable hyperlinks into PDF document. unit Main; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, StdCtrls, Forms, Dialogs, HPDFDoc; type TForm1 = class(TForm) HotPDF: THotPDF; HelloWorldButton: TButton; edtWeb: TEdit; edtProduct: TEdit; edtOrder: TEdit; edtContact: TEdit; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; procedure HelloWorldButtonClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.HelloWorldButtonClick(Sender: TObject); begin HotPDF.BeginDoc; HotPDF.CurrentPage.SetFont( ‘Microsoft Sans Serif’, [], 13 );…

Read More Read More

HotPDF Text Annotation

HotPDF Text Annotation

This HotPDF Component sample adds a text annotation at the specified location of the PDF document. program Annotation; {$APPTYPE CONSOLE} uses {$IFDEF VER230} System.Classes, System.SysUtils, Vcl.Graphics, {$ELSE} Classes, SysUtils, Graphics, {$ENDIF} HPDFDoc; var HotPDF: THotPDF; begin HotPDF := THotPDF.Create(nil); try HotPDF.FileName := ‘Annotation.pdf’; HotPDF.BeginDoc; HotPDF.CurrentPage.TextOut(120,65,0,’Click the icon:’); HotPDF.CurrentPage.AddTextAnnotation( ‘This is a text annotation.’ + #13#10 + ‘Dies ist eine Textanmerkung.’ + #13#10 + ‘Ceci est une annotation textuelle.’ + #13#10, Rect(120, 80, 140, 100), true, taComment, clBlue ); HotPDF.EndDoc; finally…

Read More Read More