Print
Properties

This property makes it possible to set
printoptions: header, footer, margins, paper orientation
programmatically. At design-time the properties are loaded
from registry and margins converted to the unit of
measurement found in your LocaleID. This means that the
properties will appear as in the Pagesetup dialog.
At run-time Embeddedwb checks the users
LocaleID and makes the nessecary conversions between inch/millimeters
and find the proper decimalseparator before it sends
strings to the pagesetup-dialog. This is important in
international applications.
If you call function "Print"
with printoptions.enabled:=true the pagesetup dialog will
be opened outside the screen and printoption-values
entered. Then the dialog is closed and then
"normal" Print-function called.
If you call PageSetup-Dialog with
Printoptions.enabled:=true the printoptions-values are
entered in the dialog before it opens.
Set PrintOptions.Enabled:=False if you do
not want to use PrintOptions.
You can easily add more properties. Just
keep in mind that the Printsetup dialog has changed in
Windows 2000. Avoid using Windows-titles as identifiers
for dialog-boxes if you develop multi-language
applications.
procedure
TForm1.Button1Click(Sender: TObject);
begin
with EmbeddedWB1.PrintOptions do
begin
Orientation:=Landscape;
Margins.Left:=16.75;
// always use the unit of measurement defined
on your own computer.
//EmbeddedWB converts
at run-time if nessecary.
Header:='This is my new header';
Enabled:=True;
end;
EmbeddedWB1.Print;
end; |