CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 1999
    Posts
    6

    Urgent Printing Help!!



    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.




  2. #2
    Join Date
    Apr 1999
    Posts
    5

    Re: Urgent Printing Help!!



    And that's just one reason not to use Doc-View.


    Fonts are not scaled...


    Patrick Frants

  3. #3
    Join Date
    Mar 1999
    Posts
    6

    Re: Urgent Printing Help!!



    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



  4. #4
    Join Date
    Apr 1999
    Posts
    5

    Re: Urgent Printing Help!!



    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

  5. #5
    Join Date
    Apr 1999
    Posts
    30

    May be a suggestion



    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

  6. #6
    Join Date
    Apr 1999
    Posts
    1

    Re: Urgent Printing Help!!

    I'm having the same problem. If you find a way around, please let me know.


  7. #7
    Join Date
    Feb 2000
    Location
    Atlanta, GA
    Posts
    2

    Re: Problem is with MM_TEXT

    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


  8. #8
    Guest

    Re: Problem is with MM_TEXT

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured