PrintPreview and printed result are different.

  • Thread starter Thread starter TheSteph
  • Start date Start date
T

TheSteph

Hi,

When I Preview a PrintDocument, it's perfectly formatted. But when I print
it on the Printer, the result is different : text and grid are truncated at
the right edge of the page. (no matter on witch printer I print).

It's like if a string of 1 inch on the Preview become a string of 1.1 inch
on the printer..

Of course I would like that PrintPreview and the real printed document looks
the same.

am I missing something ? Does anybody know why Preview and real print may be
different ?

Thanks for any help !

Steph.
 
May have to do with printing text with printer fonts instead of graphics (a
print settings setting).

Maybe if you post some code that reproduces the problem we might see
something more obvious.

But, keep in mind, they'll never be identical. The screen is usually at
96dpi and printers can range from 100-1200+ DPI, add printer font/screen
fonts you're bound to be slightly different. It would also depend on the
coordinate system used for drawing; but, I'm assuming you haven't changed
that.
 
May have to do with printing text with printer fonts instead of graphics
(a
print settings setting).

Maybe if you post some code that reproduces the problem we might see
something more obvious.

But, keep in mind, they'll never be identical. The screen is usually at
96dpi and printers can range from 100-1200+ DPI, add printer font/screen
fonts you're bound to be slightly different. [...]

I note that this appears to be a limitation with the .NET printing API. I
have not yet found a .NET-supported way to get a Graphics object that
reflects the printer metrics.

In the native Win32 API, you could create a printer DC based on a DEVMODE,
without actually starting a print job. This was very useful for doing
things like page layout, pagination, and print preview operations. For
the reasons you mentioned, using screen metrics can result in layout
problems.

That said, I am a bit surprised that the .NET print preview controller
stuff doesn't at least do this "behind the scenes". That is, it's bad
enough that .NET doesn't offer the application access to a non-printjob
Graphics object, but it ought to at least be creating and using one for
the purpose of the print preview. My impression from this thread is that
it does not, which seems a little silly.

Of course, I haven't verified myself that this really is a screen/printer
DC incompatibility issue. I agree that it seems a lot like that's what is
probably going on, but I can't rule out other possibilities.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top