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.

Continue Reading …

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;Continue Reading …

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;Continue Reading …

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;Continue Reading …

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;Continue Reading …

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;Continue Reading …

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’,Continue Reading …

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;Continue Reading …

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,Continue Reading …