Link to home
Start Free TrialLog in
Avatar of Charlene100299
Charlene100299

asked on

Printform vs Screen area

When using printform on my machine, whose set to 1024 x 768, all is well.  But, when I use the same thing on a 800 x 600 monitor, a part of the report don't get printed.
I suppose it means printform graphically print what shown on the screen.
Is there a way to avoid or patch this?
If no, is there a way for me to change the screen resolution for the duration of the printform?

thanks!!
Avatar of Erick37
Erick37
Flag of United States of America image

If you are using VB6, try using a borderless window to print the form (BorderStyle = 0).
ASKER CERTIFIED SOLUTION
Avatar of julianpointer
julianpointer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mark2150
mark2150

Printform is really not a good way to print. You get interactions between the resolution of the screen and the printer. Ultimately everything comes down to dots. Your image on the screen is, say 1024x768. If you're printing on a 300 DPI printer you get 3-1/2" or so printout. If the printer is changed to 600 DPI the image shrinks to under 2"! If you change the screen rez the print image switches. Trying to account for ever permutation of printer rez and screen rez makes this approach unworkable.

The right way to generate printout is to draw it to the print device instead of using PrintForm. This is more hassle to code but gives you device independence. No matter what the res of the screen or the rez of the printer your output will come out the same and at the best quality that the printer is capable of. (try printing the 1024x768 screen on a 150 DPI printer and you'll see what I mean)

You use the .Scale property to size your printer. You use CurrentX/Y to position the print cursor and Printer.Print to lay down text. You can figure out how big text is in the currently selected font with .TextWidth/Height. You draw lines and boxes with .Line. You can add circles or other simple shapes or throw down images.

Formatting text paragraphs is a bit of a pain, but not impossible. You can right/left center justify by fiddling the Printer.CurrentX param. One thing that the logical printer can do that a physical printer can't is move back up the page. PrintForm also doesn't give you much control over where on the page it prints or allow you to print two per page.

I have several examples on my web page showing how to generate graphs and such that also illustrate using the *same* routine for screen preview and printing. The CDLabeller program shows how to generate specifically dimensioned lines and graphics. Visit: www.cyberchute.com/rvbus/madmark and please sign the guest book if you take anything.

M