You are on page 1of 17

H H

F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

Installation FastReport VCL 6 Trial


April 29, 2019
First of all you need to download the program from the developer’s site

1. Run the installer. First we will see the welcome window. Click Next to continue
the installation.

2. In the second step, we are invited to read the license terms. If you agree to these
terms, tick the ‘I accept the terms of the license agreement’box and click the
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

Next button.

3. In the third step, you can familiarize yourself with important information about
the FastReport VCL 6 product.
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

4. Next, we can choose the type of installation: Complete and Custom.

5. The first type allows you to install all program components by default, and the
second one - select the necessary ones:
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

6. Select the folder on the local disk where you want the program to be installed:

7. Then, you can specify the name of the directory in which the launch shortcuts
will be located. You also need to choose for which users the program is
supposed to be installed. Either for one, current user, or for all.

8. The next step is the last opportunity to think about whether you set all the
installation settings correctly. If you are sure of the previous settings, click Next.
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

Otherwise - Back to return to the previous step.

9. After clicking the Next button, the program will be installed:


H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

10. The last window informs you of the successful installation.

11. Immediately after the installation is completed, a utility will be launched, which
will allow compiling the FastReport libraries to the required Delphi version:

You can refuse to compile by clicking the Exit button, or accept using the Continue
button:
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

The compilation wizard allows you to set a lot of parameters: compiler, FastReport
version, TeeChart charts component, change actions. By default, the FastReport
libraries are already compiled, and this utility simply prompts you to compile them with
your own settings.
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

How to make a PDF from Delphi /


C++Builder / Lazarus

May 14, 2020


Quite often, you need to get a PDF document from a Pascal application - either Delphi
or Lazarus.
Usually it is recommended to use specialized solutions, PDF converters (such as itext,
Synopse PDF Engine, PowerPDF, HotPDF, PDF Creator Pilot, PDFtoolkit VCL,
Debenu Quick PDF Library etc.). In this article we will not consider their advantages
and disadvantages.
Unexpectedly for us, it turned out that even if there is no “PDF”in the product name,
the capabilities of FastReport VCL for PDF output in Delphi cover many of the
developer’s needs. And many of our customers use ONLY FastReport features to make
PDF!
So, first of all –you can send any arbitrary complex report to PDF. Let’s try!

Create a new VCL application in Delphi


Add TfrxReport, TfrxPDFExport and TButton components from the FastReport tab to
the form.

Double-click on TfrxReport, enter FR Designer. Create a new report (File -> New
report). Add TfrxMemoView with the text “Test text” to MasterData1.
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

Set MasterData1.RowCount = 200 (to repeat the line 200 times and generate a 3-4-
page report, since our example does not use the dataset), exit the designer and write the
OnClick handler for Button1:
1 procedure TForm1.Button1Click(Sender: TObject);
2 begin
3 {Generate a report. The report must be generated before exporting}
4 if frxReport1.PrepareReport then
5 frxReport1.ShowPreparedReport;
6 {and show preview window}
7 end;
In fact, this code is enough for comprehensive work, generating a report and exporting
to PDF. Now create a document of any complexity in Design time (you can connect any
data sources and take the information from there) –tables, lists, illustrations, maps, QR
codes –for this make sure to add the appropriate components to the project first
(otherwise they will not exist in Run time), composite and multi-page documents with
anchors, inline links and a table of contents –anything you need and any size –a one-
page receipt, a one-page catalog, an annual report of factory staff movements on
thousands of pages.
And don’t forget to put the PDF export component to our project! Launch and click on
the only button on the form.
We can see the preview window and the export to PDF button.

Go ahead – save a PDF from our Delphi application!


Click on the button –call the export from the preview below I’ll show you how to do all
this from the code, you can just click on the link –send to PDF from the code).
Immediately we see the resulting PDF settings dialog.
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

As you can see, any professional PDF converter will envy such a set of options! We can
choose which pages of our document to send to PDF, which version of PDF to use,
compression reduces the size of the resulting file, embedding fonts allows to save the
appearance of the document of any third-party device. We can choose if the background
will be attached to the PDF document; our PDF can also be optimized for printing
(image quality will be better but the size will be larger) or only for on-screen
presentation. We can set if the resulting PDF will contain an external table of contents
as in the original report (I don’t have it in my example so it is not possible to select it),
transparency, compression ratio of bitmap images. By the way, one of the important
features of FastReport VCL 6.6 is that vector images will remain a vector form in a PDF
file, in other words –lossless, and this will be especially noticeable on 2D barcodes and
maps. Another feature –all text, including RTF, will be vectorized when saved to PDF,
i.e. the quality will not be lost while retaining the ability to copy a section of text from
PDF (unless you prohibit the appropriate option which I will mention below).
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

Save to: where exactly we will send our PDF (local file or e-mail or clouds). Open after
export - the resulting file will be opened immediately after export by the PDF viewer
assigned by default to the operating system (for example, Adobe Acrobat Reader).
You can export the generated document in archive formats such as PDF/A-1a, PDF/A-
1b, PDF/A-2a, PDF/A-2b, PDF/A-3a, PDF/A-3b –they are specially designed for
keeping documents unchanged in electronic form. For example, fonts, images, third-
party objects that are present in a document are automatically embedded in the
document in this standard. Quite often one of these standards is used for electronic
document management in large organizations. By the way, here you can read a little
more about the difference between PDF and PDF/A.
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

The non-archive PDF format also has several versions (and you can choose which one
to save).
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

Service information, which will also go to a PDF file: title, author, subject, keywords
(you can upload PDF to the web, it will be perfectly indexed), PDF authoring tool,
document producer.

Security –protecting the document from opening by using a password (using RC4
encryption).
The ability to prohibit printing and modifying a document, copying of text and graphics,
adding or modifying text notes.
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

Setting up the PDF viewer when you open the document:


Hide toolbar, hide menubar, hide window user interface, fit window, center window,
print scaling. Usually, when exporting I use the parameters set by default but this time I
reviewed all the parameters.

So, if we or our users do not need all this visual diversity, then we can immediately

send to PDF from Delphi or Lazarus code


saving to PDF from Delphi with PDF parameters
1 procedure TForm1.Button1Click(Sender: TObject);
2 begin
3 {Generate a report. The report must be generated before exporting}
4 frxReport1.PrepareReport();
5 {Set the range of pages to export. By default, all pages of the generated
6 report are exported.}
7 frxPDFExport1.PageNumbers := '2-3';
8 {Set the PDF standard
9 TPDFStandard = (psNone, psPDFA_1a, psPDFA_1b, psPDFA_2a, psPDFA_2b,
10 psPDFA_3a, psPDFA_3b);
11 It is required to add the frxExportPDFHelpers module to the uses list:
12 uses frxExportPDFHelpers;}
13 frxPDFExport1.PDFStandard := psNone;
14 {You can set the PDF standard version for PDFStandard = psNone
15 TPDFVersion = (pv14, pv15, pv16, pv17);
16 It is required to add the frxExportPDFHelpers module to the uses list:
17 uses frxExportPDFHelpers;}
18 frxPDFExport1.PDFVersion := pv17;
19 {To get smaller file size, you can set the compression}
20 frxPDFExport1.Compressed := True;
21 {Set whether to embed fonts in the resulting document.
22 Embedding fonts significantly increases the size of the resulting
23 document}
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

saving to PDF from Delphi with PDF parameters


24 frxPDFExport1.EmbeddedFonts := False;
25 {Set whether we need to export the background image}
26 frxPDFExport1.Background := True;
27 {Disable export of objects with optimization for printing. With option
28 enabled images will be high-quality but 9 times larger in volume}
29 frxPDFExport1.PrintOptimized := False;
30 {Set whether the resulting PDF will contain an external table of contents,
31 as in the original report}
32 frxPDFExport1.Outline := False;
33 {Set whether to export images with transparency}
34 frxPDFExport1.Transparency := True;
35 {You can set the desired DPI of images. Enabling this option disables
36 SaveOriginalImages option, which allows you to save images in their
37 original form}
38 frxPDFExport1.PictureDPI := 150;
39 {Set the compression ratio of bitmap images}
40 frxPDFExport1.Quality := 95;
41 {Set whether to open the resulting file after export}
42 frxPDFExport1.OpenAfterExport := False;
43 {Set whether to display export progress
44 (show which page is currently being exported)}
45 frxPDFExport1.ShowProgress := False;
46 {Set whether to display a dialog box with export filter settings}
47 frxPDFExport1.ShowDialog := False;
48 {Set the name of the resulting file. Please note that if you do not set the
49 file name and disable the export filter dialog box, the file name selection
50 dialog will still be displayed}
51 frxPDFExport1.FileName := 'C:\Output\test.pdf';
52 {Fill in the corresponding fields of the Information tab}
53 frxPDFExport1.Title := 'Your Title';
54 frxPDFExport1.Author := 'Your Name';
55 frxPDFExport1.Subject := 'Your Subject';
56 frxPDFExport1.Keywords := 'Your Keywords';
57 frxPDFExport1.Creator := 'Creator Name';
58 frxPDFExport1.Producer := 'Producer Name';
59 { Fill in the corresponding fields of the Security tab }
60 frxPDFExport1.UserPassword := 'User Password';
61 frxPDFExport1.OwnerPassword := 'Owner Password';
62 frxPDFExport1.ProtectionFlags := [ePrint, eModify, eCopy, eAnnot];
63 {Set the Viewer settings (Viewer tab)}
64 frxPDFExport1.HideToolbar := False;
65 frxPDFExport1.HideMenubar := False;
frxPDFExport1.HideWindowUI := False;
frxPDFExport1.FitWindow := False;
frxPDFExport1.CenterWindow := False;
frxPDFExport1.PrintScaling := False;
{Export the report}
frxReport1.Export(frxPDFExport1);
end;

There you go –use it! Here are considered the functions and recording options from
Lazarus and Delphi to PDF FastReport VCL version 6.6. The cost of a license is
comparable (and often less) to the monthly salary of a developer, while only the options
for setting up and saving to different versions of PDF here are equal to at least work-
months of a developer with high qualifications and knowledge of the subtleties of
different dialects of PDF.
By the way, you can even check the quality of the PDF conversion on our demo reports
or some of your own for fun. We constantly check and test them for compliance with
PDF standards (there are special validators but at the same time the validation passage
does not always guarantee the correspondence of what you see and what will be printed,
we have all those individual stories about it). For example, do you know how beautiful
H H
F-XC A N GE F-XC A N GE
PD PD

!
W

W
O

O
N

N
y

y
bu

bu
to

to
k

k
lic

lic
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u-tr a c k c u-tr a c k

illustrations in your PDF will be? Read more here: https://www.fast-


report.com/en/blog/200/show/.

https://www.fast-report.com/en/blog/324/show/

You might also like