Click to See Complete Forum and Search --> : Urgent Printing Help!!
Walter An
March 30th, 1999, 02:39 AM
Hello, Everyone.
I am currently working on a report printing module.
I have a long string to print in a user defined area by setting margins.
Everything looks Okay on preview which wraps the string when its length
go over the right margin. But when I print that string to a hardcopy, it does
what the preview does EXCEPT MORE CHARACTERS ARE PRINTED ON A LINE. I mean
it isn't WYSIWYG.
Somehow my printer outputs more characters on single line than what the
preview shows. I did look almost everywhere on Internet and bookstores for
some tips on print and preview , or should I say WYSIWYG printing. But
no one seems to have a problem that I have...
Did I miss something? I hope someone can help me on this.
Thank you in advance. :)
Walter An.
Patrick Frants
March 30th, 1999, 06:08 AM
And that's just one reason not to use Doc-View.
Fonts are not scaled...
Patrick Frants
Walter An
March 30th, 1999, 08:55 PM
Thank you for your reply, Pat.
Does that mean we have to implement our own preivew module
to be WYSIWYG?
Doesn't MFC support or emulate WYSIWYG by using its Doc-View class?
I don't quite understand what you mean by "Fonts are not scaled".
Can u explain a little more?
Here are what I have done.
I have created a font using "CreateFontIndrect" to be used in
preview and print.
I have used "GetTextExtentExPoint" function to retreive the
number characters that can be printed in a given width of area.
But in preview mode and print mode, this number returns two
different numbers which as you expected from my question, print
mode returns larger number ALTHOUGH THE GIVEN WIDTH IS SAME.
My mappping is MM_TEXT.
Any suggestion will be greatly appreciated?
Thank you again.
Walter An
Patrick Frants
March 31st, 1999, 02:48 AM
Doc-View scales points etc ok.
But when you create a 9pt font for example, it is 9 pt regardless of the
zooming factor of the print preview. And the 100% zoom is not the same as on
paper and as a result it looks differently. The trick is to be able to scale
fonts properly. So if you zoom in to 200% the font size needs to be 18pt instead
of 9pt. Doc-View does not do this for you.
Hope this clears things up.
Patrick
Santhosh Cheeran
March 31st, 1999, 11:28 PM
I don't know how you're implemeting it, but as a suggestion, it can be because of the difference between the screendc and printer dc attributes. So operate on printer dc attributes, irrespective of whether it is a print or a preview call,use (CWinapp I guess)GetPrinterDC function and use its attributes for the PreviewDC. Otherwise you may get the same problems with different printer drivers if not with the present one, because of different font scaling from driver to driver
M. Schoneman
April 13th, 1999, 03:13 PM
I'm having the same problem. If you find a way around, please let me know.
bretzlaff
May 18th, 2000, 09:05 AM
The problem is with MM_TEXT. It works off of pixels and depends on the resolution. A 300 DPI printer most closely mimics the output of the print preview. If you look at your printer resolution, try changing the resolution and printing it. You should see a major difference.
You want to use MM_LOENGLISH which corresponds to .01 inches regardless of the printer resolution. The problem with MM_LOENGLISH is it reverses the Y-AXIS and results in backwards calculations.
Look at the Scribble Tutorial under the Specify the Mapping Mode section.
Another possibility is that you are using something prior to Visual C++ 6.0 and are falling victim to a bug with print preview not honoring font width settings. See knowledge base article: Q173249
I would concur with this response. MM_LOENGLISH requires a bit more overhead to work with, but it pays big dividends in the long wrong. Screen and printer outputs not only match up well, but printer manufacturer to different printer manufacturer match up very well also.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.