Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Unexpected printing behaviour

Unexpected printing behaviour

Scheduled Pinned Locked Moved C / C++ / MFC
c++debugginghelpquestionannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Santanu Lahiri
    wrote on last edited by
    #1

    Hello all, I am running into a somewhat odd problem with printing from an MFC program. I am getting printouts just fine, but there seems to be a difference between the preview page and the printed page. The preview, in this case, prints 40 lines to a page, while the printed version prints 41. Since the overall printout is about 64-65 pages long, this is causing the last few pages to be very different between the two. I put in some TRACE statements to print the height of a line with each font type I am using, and this is what I got (the fonts are all Times New Roman, various point sizes): For the Preview version:

    Preparing Page 2
    Page 2
    Report Hdr: 00155
    Page Hdr: 00095
    Table Caption: 00115
    Column Hdr: 00115
    Table Body: 00095
    Table Total: 00095
    Page Footer: 00075
    Report Footer: 00075
    Printing Page 2
    Line Start 1110
    Line Start 1225
    Line Start 1340
    Line Start 1455
    Line Start 1570
    Line Start 1685
    Line Start 1800
    ...
    Line Start 5020
    Line Start 5135
    Line Start 5250
    Line Start 5365
    Line Start 5480
    Line Start 5595

    For the Print version:

    Preparing Page 2
    Page 2
    Report Hdr: 00151
    Page Hdr: 00094
    Table Caption: 00114
    Column Hdr: 00114
    Table Body: 00094
    Table Total: 00093
    Page Footer: 00075
    Report Footer: 00075
    Printing Page 2
    Line Start 1108
    Line Start 1222
    Line Start 1336
    Line Start 1450
    Line Start 1564
    Line Start 1678
    Line Start 1792
    ...
    Line Start 4984
    Line Start 5098
    Line Start 5212
    Line Start 5326
    Line Start 5440
    Line Start 5554
    Line Start 5668

    As you can see, the font heights are a little different. This is causing an extra line per page. I did not think this was possible, since I am using the default printer definition in both cases. Is there any way to compensate for this? Thanks for any hint anyone can provide. Santanu

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups