0% found this document useful (0 votes)
232 views13 pages

Powerpdf Reference: Veision 0.8 (Beta)

The document describes a PDF library called PowerPdf. It contains an introduction and chapters describing the components in the library. The chapters cover the main report component, page component, layout panel component, grid panel component and text component.

Uploaded by

mustafa gülmez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
232 views13 pages

Powerpdf Reference: Veision 0.8 (Beta)

The document describes a PDF library called PowerPdf. It contains an introduction and chapters describing the components in the library. The chapters cover the main report component, page component, layout panel component, grid panel component and text component.

Uploaded by

mustafa gülmez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

PowerPdf Reference

Veision 0.8(beta)

copyright (c) 1999-2001 takeshi kanno


1

Contents
Chapter 1: Introduction
1.1 What Is PowerPdf
1.2 Requires
1.3 Installation
Chapter 2: Component Reference
2.1 TPReport
2.1.1 TPReport properties
2.1.2 TPReport methods
2.2 TPRPage
2.2.1 TPRPage properties
2.2.2 TPRPage events
2.3 TPRLayoutPanel
2.3.1 TPRLayoutPanel properties
2.3.2 TPRLayoutPanel events
2.4 TPRGridPanel
2.4.1 TPRGridPanel properties
2.4.2 TPRGridPanel events
2.5 TPRText
2.5.1 TPRText properties
2.6 TPRImage
2.6.1 TPRImage properties
2.7 TPRRect
2.7.1 TPRRect properties

copyright (c) 1999-2001 takeshi kanno


2

CHAPTER 1

Introduction

1.1 What Is PowerPdf


PowerPdf is a VCL to create PDF docment visually. Like QuickReport, you can
design PDF document easily on Delphi IDE.

1.2 Requires
Delphi3.0 or later.

1.3 Installation
1.Extracts the files from powerpdf.zip.
2.Choose Component|Install Component, and install PReport.pas.
NOTE
If you want to use FlateDecode/Zlib compression, copy zlib.pas and *.obj files (these are
included in Delphi's CD-ROM) to your librally path.

copyright (c) 1999-2001 takeshi kanno


3

CHAPTER 2

Component Reference

2.1 TPReport
TPReport encapsulates the mechanism for creating pdf document.

Unit
PReport

Description
Use TPReport to create pdf document. Like TPrinter. To start print job, call the BeginDoc
method.To print page, call the Print method. And call the EndDoc method to terminate
print job.If you want to terminate print job unless saving document, call the Abort method.

2.1.1 TPReport properties


property FileName: string;
Set FileName to specify the file name to save document.
property Author: string;
Set Author to specify the author of the document.
property CreationDate: TDateTime;
Set CreationDate to specify the date and time when the document was created.
property Creator string;
Set Creator to specify the creator of the document.
property Keywords string;
Set Keywords to specify keywords of the document.
property ModDate: TDateTime;
Set Keywords to specify the date and time when the document was last modified.
property Subject: string;
Set Subject to specify the subject of the document.
property Title: string;
Set Title to specify the title of the document.

copyright (c) 1999-2001 takeshi kanno


4

property PageMode: TPdfPageMode;


PageMode property specifies how the document should be displayed when opened.

TPdfPageMode = (pmUseNone, pmUseOutlines, pmUseThumbs, pmFullScreen);


pmUseNone Both of outline and thumbnail images invisible
pmUseOutlines Document outline visible
pmUseThumbs Thumbnail images visible
pmFullScreen Full-screen mode, with no menu bar.

property CompressionMethod: TPdfCompressionMethod;


Cmpression property specifies the filter to compress contents and images.

TPdfCompressionMethod = (cmNone, cmFlateDecode);


cmNone No compression method is used
cmFlateDecode Compresses data using the zlib/deflate compression method
Note: If you want to use FlateDecode, you must do following operations.
1. Add zlib unit and *.obj files(these are included in Delphi's CD-ROM) in your library
path.
2. Commentout compile option "{$DEFINE NOZLIB}" in PdfDoc.pas and PdfTypes.pas.
3. Rebuiled the package.
property PageNumber: integer;
PageNumber contains the current page number being printed.

2.1.2 TPReport methods


procedure BeginDoc;
BeginDoc starts to create PDF document.
procedure Print(APage: TPRPage);
Print add the page that specified APage parameter to the PDF document.
procedure EndDoc;
EndDoc ends the current print job and outputs PDF document to the file.
procedure Abort;
Abort terminates the current print job, dropping all data.

copyright (c) 1999-2001 takeshi kanno


5

2.2 TPRPage
TPRPage represents a page to print.

Unit
PReport

Description
Use TPRPage to create a page to print. To create a page, To print a page, call print method
of TPReport with TPRPage object.
Use Width and Height property to determine the physical size of the page.

2.2.1 TPRPage properties


property MarginTop: integer;
Set MarginTop to specify the top margin of the document.
property MarginLeft: integer;
Set MarginLeft to specify the left margin of the document.
property MarginRight: integer;
Set MarginLeft to specify the left margin of the document.
property MarginBottom: integer;
Set MarginBottom to specify the bottom margin of the document.
property Height: integer;
Set Height to specify the height of the page.
property Width: integer;
Set Width to specify the width of the page.

2.2.2 TPRPage events


property OnPrintPage: TPRPrintPageEvent;
OnPrintPage is called when a page is printed. You can use it to initialize any local
variables.

copyright (c) 1999-2001 takeshi kanno


6

2.3 TPRLayoutPanel
TPRLayoutPanel is main building block of a page.

Unit
PReport

Description
To make a page, put TPRPanel on the TPRPage component and put Item component
(TPRItem, TPRImage and so on) on the TPRPanel.

2.3.1 TPRLayoutPanel properties


property Align: TAlign;
Align determines how the TPRLayoutPanel aligns within TPRPage (or TPRPanel).

2.3.2 TPRLayoutPanel events


property BeforePrint: TPRPrintPanelEvent;
BeforePrint is called before a page is about to be printed. Typical use of this event
is to set any variables(TPRText, TPRImage).

TPRPrintPanelEvent = procedure(Sender: TObject; ACanvas: TPdfCanvas;


Rect: TRect) of object;

property AfterPrint: TPRPrintPanelEvent;


AfterPrint is called after a page was printed.

copyright (c) 1999-2001 takeshi kanno


7

2.4 TPRGridPanel
TPRGridPanel is used to print a table.

Unit
PReport

Description
A typical use of TPRGrid is to print a table(like a database data). set RowCount and
ColCount property to define row count and column count.

2.4.1 TPRGridPanel properties


property Align: TAlign;
Align determines how the TPRGridPanel aligns within TPRPage (or TPRPanel).
property ColCount: integer;
ColCount determines how many numbers of columns in this panel.
property RowCount: integer;
RowCount determines how many numbers of rows in this panel.
property PrintDirection: TPrintDirection;
PrintDirection determins the direction of printing grid.

2.4.2 TPRGridPanel events


property BeforePrint: TPRPrintPanelEvent;
BeforePrint is called before a page is about to be printed. Typical use of this event
is to set any variables(TPRText, TPRImage).
TPRPrintPanelEvent = procedure(Sender: TObject; ACanvas: TPdfCanvas;
Rect: TRect) of object;

property AfterPrint: TPRPrintPanelEvent;


AfterPrint is called after a page was printed.
property BeforePrintChild: TPRPrintChildPanelEvent;
BeforePrintChild is called every before child panels are about to be printed. Typical
use of this event is to set any variables(TPRText, TPRImage).
TPRPrintChildPanelEvent = procedure(Sender: TObject; ACanvas: TPdfCanvas;
ACol, ARow: integer; Rect: TRect) of object;

property AfterPrintChild: TPRPrintChildPanelEvent;


AfterPrint is called every after panels were printed.

copyright (c) 1999-2001 takeshi kanno


8

2.5 TPRText
TPRText is used to print a test.

Unit
PReport

Description
A typical use of TPRGrid is to print a table(like a database data). set RowCount and
ColCount property to define row count and column count.

2.5.1 TPRText properties


property Align: TAlign;
Determines how the control aligns within its container (or parent control).
property Printable: boolean;
Determines whether the control will be printed or not.
property FontColor: TColor;
Specifies the color of the text.
property FontName: TPRFontName;
Identifies the typeface of the font.
TPRFontName = (fnFixedWidth, fnArial, fnTimesRoman);

Arial
ABCDEFGabcdefg12345
TimesRoman
ABCDEFGabcdefg12345
FixedWidth
ABCDEFGabcdefg12345
property FontSize: Single;
Specifies the height of the font in points.
property FontBold: boolean;
Specifies whether the font is boldfaced or not.

copyright (c) 1999-2001 takeshi kanno


9

property Leading: Single;


Specifies the text leading.
property Lines: TStrings;
Contains the individual lines of text.
property WordSpace: Single;
Specifies the word spacing of the text.
property WordWrap: boolean;
Determines whether the text inserts soft carriage returns so text wraps at the right m

copyright (c) 1999-2001 takeshi kanno


10

2.6 TPRImage
TPRGridPanel is uses to print a table.

Unit
PReport

Description
A typical use of TPRGrid is to print a table(like a database data). set RowCount and
ColCount property to define row count and column count.

2.6.1 TPRImage properties


property Align: TAlign;
Determines how the control aligns within its container (or parent control).
property Printable: boolean;
Determines whether the control will be printed or not.
property Picture: TPicture;
Specifies the image that appears on the control.
property SharedImage: boolean;
Determines whether the image data will be shared in the document or not.
if this property is set true, the PDF file has only one image, This means disk capacity
can be saved.
But if the image of each page is different, SharedImage property must be set false.
See DBImageExample(not shared image)

copyright (c) 1999-2001 takeshi kanno


11

2.7 TPRRect
TPRRect is used to draw rectangles and lines on a report.

Unit
PReport

2.7.1 TPRRect properties


property Align: TAlign;
Align determines how the TPRRect aligns within container (or parent control).
property FillColor: TColor;
FillColor determines fill style for the Rectangle.
property LineColor: TColor;
LineColor determines color of the lines for the Rectangle.
property LineStyle: TPenStyle;
LineStyle determines the style in which the pen draws lines.

TPenStyle = (psSolid, psDash, psDot, psDashDot,


psDashDotDot, psClear, psInsideFrame);

psSolid
psDash
psDashDot
psDashDotDot
psDot
psClear(Invisible)

copyright (c) 1999-2001 takeshi kanno


12

Copyright
Copyright (C) 1999-2001 Takeshi Kanno

This library is free software; you can redistribute it and/or modify it under the
terms of the GNU Library General Public License as published by the Free
Software Foundation; either version 2 of the License, or any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library general Public
License for more details.

copyright (c) 1999-2001 takeshi kanno

You might also like