By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,459 Members | 1,472 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,459 IT Pros & Developers. It's quick & easy.

PrintForm in Hight quality

P: n/a
Hi,
I am designing a business card application, after designing the card which is a windows form, I want to print the form, but the PrintForm prints in poor quality (96 dpi), is there a way to print the form at the same quality of it controls (images for example)?

please help.
Jul 1 '08 #1
Share this Question
Share on Google+
8 Replies


P: n/a
I have a Control Printer class on my blog (below) which has a function called
GetControlImage which will give you an image of a control, or in your case a
form.
Then you cant print that image however you want, or it can do it for you.

HTH

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Tarek Al-Jamal" wrote:
Hi,
I am designing a business card application, after designing the card which is a windows form, I want to print the form, but the PrintForm prints in poor quality (96 dpi), is there a way to print the form at the same quality of it controls (images for example)?

please help
Jul 1 '08 #2

P: n/a
Thank you for your quick reply, but BitBlt captures the screen in 96 dpi, I want to capture it in high resolution to be printed in high resolution too.
Please help
"Ciaran O''Donnell" <Ci************@discussions.microsoft.comwrote in message news:E0**********************************@microsof t.com...
I have a Control Printer class on my blog (below) which has a function called
GetControlImage which will give you an image of a control, or in your case a
form.
Then you cant print that image however you want, or it can do it for you.

HTH

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Tarek Al-Jamal" wrote:
Hi,
I am designing a business card application, after designing the card which is a windows form, I want to print the form, but the PrintForm prints in poor quality (96 dpi), is there a way to print the form at the same quality of it controls (images for example)?

please help
Jul 1 '08 #3

P: n/a
On Tue, 01 Jul 2008 03:44:38 -0700, Tarek Al-Jamal <Ta****@saudisoft.com>
wrote:
Hi,
I am designing a business card application, after designing the card
which is a windows form, I want to print the form, but the PrintForm
prints in poor quality (96 dpi), is there a way to print the form at the
same quality of it controls (images for example)?
I don't believe that there's a way using only managed code. But printing
a form is really a poor way to control printing anyway. You would be
better off simply using the data from the form to print explicitly
yourself (using PrintDocument, etc.).

Pete
Jul 1 '08 #4

P: n/a
Peter Duniho <Np*********@nnowslpianmk.comwrote:
Tarek Al-Jamal <Ta****@saudisoft.comwrote:
Hi,
I am designing a business card application, after designing the card
which is a windows form, I want to print the form, but the PrintForm
prints in poor quality (96 dpi), is there a way to print the form at the
same quality of it controls (images for example)?

I don't believe that there's a way using only managed code. But printing
a form is really a poor way to control printing anyway. You would be
better off simply using the data from the form to print explicitly
yourself (using PrintDocument, etc.).
This seems to be the thinking of MS (i.e. the reason why they don't
include a printform method in the framework)....both you and they are
wrong.

Printing the data from the form explicitly is, in a lot of cases,
simply a duplication of effort -- you have already spent time and
effort getting the layout of the controls and labels for your data into
an acceptable state.

Now you're supposed to spend *more* time and effort making a *new*
layout that presents the same data (with appropriate labels)....why?

IME in most cases the form on the screen is a perfectly acceptable
layout, and every second you spend on the new layout and getting it to
print beyond typing in MyForm.Print() is wasted.

--
J.B. Moreno
Jul 3 '08 #5

P: n/a
On Wed, 02 Jul 2008 22:38:44 -0700, J.B. Moreno <pl***@newsreaders.com>
wrote:
>I don't believe that there's a way using only managed code. But
printing
a form is really a poor way to control printing anyway. You would be
better off simply using the data from the form to print explicitly
yourself (using PrintDocument, etc.).

This seems to be the thinking of MS (i.e. the reason why they don't
include a printform method in the framework)....both you and they are
wrong.
You are welcome to your opinion. Suffice to say, I disagree.

In any case, being argumentative and dismissive isn't going to get you
anywhere. If I thought you were open to new ideas, I'd explain your
mistake to you. But it's clear you've made up your mind. Good luck with
that.

Pete
Jul 3 '08 #6

P: n/a
Peter Duniho <Np*********@nnowslpianmk.comwrote:
J.B. Moreno <pl***@newsreaders.comwrote:
But printing a form is really a poor way to control printing
anyway. You would be better off simply using the data from the
form to print explicitly yourself (using PrintDocument, etc.).
This seems to be the thinking of MS (i.e. the reason why they don't
include a printform method in the framework)....both you and they are
wrong.

You are welcome to your opinion. Suffice to say, I disagree.

In any case, being argumentative and dismissive isn't going to get you
anywhere. If I thought you were open to new ideas, I'd explain your
mistake to you.
Oh, I'm open to new ideas, but it'd have to be some argument to show
that having fewer choices is better than having more choices.

But it's clear you've made up your mind. Good luck with
that.
And you accused me of being dismissive...

--
J.B. Moreno
Jul 4 '08 #7

P: n/a
It will be very nice if you can guide me on any site has samples for printing the form using PrintDocument.
Thanks
"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message news:op***************@petes-computer.local...
On Tue, 01 Jul 2008 03:44:38 -0700, Tarek Al-Jamal <Ta****@saudisoft.com
wrote:
Hi,
I am designing a business card application, after designing the card
which is a windows form, I want to print the form, but the PrintForm
prints in poor quality (96 dpi), is there a way to print the form at the
same quality of it controls (images for example)?
I don't believe that there's a way using only managed code. But printing
a form is really a poor way to control printing anyway. You would be
better off simply using the data from the form to print explicitly
yourself (using PrintDocument, etc.).

Pete
Jul 8 '08 #8

P: n/a
On Tue, 08 Jul 2008 02:14:20 -0700, Tarek Al-Jamal <Ta****@saudisoft.com>
wrote:
It will be very nice if you can guide me on any site has samples for
printing the form using PrintDocument.
Please don't post HTML. Thanks.

As for your question, oddly enough, the doc page for the PrintDocument
class has a sample:
http://msdn.microsoft.com/en-us/libr...tdocument.aspx

Note that I wrote "using the data from the form", not "the form itself".
If you literally want to print the form, you're pretty much stuck with the
technique you've already found, as far as managed code goes.

But you can get excellent results by not trying to duplicate the form
itself in the printout, but rather by formatting the data contained within
the form so that it's suitable for print rather than on-screen. You'll
need to draw the data yourself in the PrintPage event handler, just as you
would for a custom control displaying the data without the aid of any
built-in controls.

The sample at the link above shows a minimal example of how to do this.
You'd simply extend the idea to include whatever data it is you want to
print.

It's certainly more work, but it will produce much better results.

By the way, if you can represent your data as a database, you may find
that using Crystal Reports will produce better quality results without as
much effort as managing the entire print process yourself. I can't say
for sure, since I have never used it myself. But I've seen the feature and
I have to believe that it's useful in at least some situations. :)

Pete
Jul 8 '08 #9

This discussion thread is closed

Replies have been disabled for this discussion.