Improve company productivity with a Business Account.Sign Up


BCB 4 TPrinter tutorial?

Posted on 2000-04-06
Medium Priority
Last Modified: 2008-03-17
Just looking for a tutorial on printing on BCB 4.  I will be printing a drawing using the standard TCanvas drawing functions, so a tutorial on formatting text won't be as useful.  I'm basically just looking for a simple tutorial which shows how to pop up the printer setup dialog box, the print dialog box and writing to the canvas, and finally sending the info to the printer selected.

Question by:jbirk
  • 4
  • 2
LVL 14

Accepted Solution

AlexVirochovsky earned 150 total points
ID: 2690334
for printing (and links).
About BCB 4 see , too,
  "Teach Yourself CPPB in 21 Days"
I hope, it helps. Alex

Author Comment

ID: 2690634
The first site looks good.  I'll read it.  The second one was a broken link...  Did the url change?


P.S. I'll grade after I read the first page and determine whther or not it will help my specific situation.

Author Comment

ID: 2690837
OK, I have a question. After the user selects their printer with print dialog box, how does the command:
TPrinter *APrinter = new Printer();
know which printer device to use?  Also will the canvas size differ with different printers?  Do I need to test for that?  I'll be scaling my drawing so that it fits on 1 page or perhaps 4 pages split in quadrants...

Also, just wondering, but will this work for plotters?

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

LVL 14

Expert Comment

ID: 2691044
1. Next is example of using:
 if (PrintDialog1->Execute())
    Printer()->Canvas->CopyRect(Image->ClientRect, Image->Canvas, Image->ClientRect);
Canvas of Printer = List of Plotter
if you know(in most case), that
size of Image != size of Plotter,
simple use StrechDraw.
2. Sorry for 2-nd URL. It was valid before 5 month.
  But you can find many tutorials (and BCB of cource ) in
must only register(free).
3. Printer use default printer, if
this is no DialogPrinter. In this case
this control use selected printer.

Author Comment

ID: 2719906
Still here, sorry for the delay:)  I'm just now getting to this part of the program.  I had asked the question in advance with anticipation of difficulties...

I'll let you know how it goes.


Author Comment

ID: 2721523
This turned out to be far more simple than I had anticipated.  I got it working flawlessly even with a four page quadrant layout.  I haven't been able to test an ink jet or plotter yet, but I'm keeping my fingers crossed:)

The PrintDialog chooses the printer so that whatever following print requests are sent use that chosen printer.  It's pretty cool.  Borland really made it all very easy (except for the documentation...  I didn't know where to start from).

Thanks for pointing me in the right direction.

Expert Comment

ID: 8426110
None of the links above are working and the question is not directly answered so I think it should be removed unless newer links are post.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question