This is how to get printer paper dimensions
PrintersetupDialog1.Execut
Printer.PrinterIndex;
Edit3.Text := IntToStr(GetDeviceCaps(Pri
Edit4.Text := IntToStr(GetDeviceCaps(Pri
Main Topics
Browse All TopicsI found next tips:
http://delphi.about.com/cs
I need to complet it with :
When I select a paper format from list to get the dimensions in mm for selected format.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: geobulPosted on 2006-09-05 at 10:22:16ID: 17457396
Hi,
: TObject);
: TObject); [lb.ItemIn dex]), PHD, nil) then begin // open the printer ); // name of the form [i].Size.c x)); // width [i].Size.c y)); // height
I have the following code wich does that but in another way. Pressing button1 will fill the listbox with the names of the printers. Select one of the printers and press button2. The richedit will be filled with the names and sizes (in thousants of mm) at once. I'm sure you can adapt it for your needs.
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls;
type
TForm1 = class(TForm)
re: TRichEdit;
lb: TListBox;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
uses Printers, WinSpool;
// fill the lb with printer names
procedure TForm1.Button1Click(Sender
begin
lb.Items.Text := Printer.Printers.Text;
end;
// get printer forms (name an size)
procedure TForm1.Button2Click(Sender
var
PHD : THandle;
info : array [0..10000] of TFormInfo1;
pcbNeeded : DWORD;
pcReturned : DWORD;
i: integer;
begin
if OpenPrinter(PChar(lb.Items
EnumForms(PHD, 1, @Info, SizeOf(Info), pcbNeeded, pcReturned); // get the info
for i := 0 to 10000 do begin
if Info[i].pName = nil then exit;
re.Lines.Add(Info[i].pName
re.Lines.Add(IntToStr(Info
re.Lines.Add(IntToStr(Info
re.Lines.Add('');
end;
ClosePrinter(PHD);
end else ShowMessage('Cannot open the printer');
end;
end.
Regards, Geo