• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 376
  • Last Modified:

problems with TPrinter::Setup(TWindow* parent)

Hallo there!
I'm using WIN95 and BC++5.01. There is a class TPrinter in the OWL wich have a function Setup(TWindow* parent). This function starts a dialog where U can choose the values of the border in the TPrinter object. All values I put there had no effect to my printing result. What's wrong there ? How can I choose the border values in an other way ?

Many thanks

        Swen
0
smeinert
Asked:
smeinert
  • 3
  • 2
1 Solution
 
md041797Commented:
After calling Setup(), call
TPrintDialog::TData& printerData = Printer->GetSetup();
This will tell you wht the user has selected.
One element of printerData is Margin, a TRect.  When you output to the printer DC, use TDC::SelectClipRgn() to set this border before you render the page.
0
 
smeinertAuthor Commented:
Sorry, does not work.

1. Is not possible to do: TPrintDialog::TData& printerData =    Printer->GetSetup(); cause of operator '='
2. Any value in printerData.Margin has no effect to the printing    result althought I put it in my TPrintout::DC with the       function TDC::SelectClipRgn().

                 Swen

0
 
md041797Commented:
1. Is not possible to do: TPrintDialog::TData& printerData = Printer->GetSetup(); cause of operator '='

GetSetup returns a TPrintDialog::TData&, so what's the problem?

Set the clip region during PrintPage().
0
 
md041797Commented:
If my answer is insufficient, you should give me an F so your question will go back to the queue to be answered by others.
0
 
smeinertAuthor Commented:
New Prob

My problem has changed now. I know now how to set the margin, but I need the physical size of paper format what was chosen to print on. I got only the printable size. There is a variable TPrintDialog::TData::PaperSize but I don't understand this value (perhaps I need a key). The main fact is: I need the real paper size in mm, inch, pix or ... or ...so I can use it.

 Many thanks
       
         Swen
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now