printing in Delphi - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

printing in Delphi

I am writing a program that draws a grid on a page, into which a user can place clip-art, jpgs, wmfs, bmps, etc (selected from files on disk). I'm providing options like pre-filling the grid with background colours, placing text in the grid, etc. Most pics have to be re-sized or stretched to fit the grid size chosen by the user.

But printing in Delphi seems to be a manual, messy business. I currently build my grid in a off-screen bitmap; I'd like to print it in a number of formats (perhaps as A4 - Port or Land, or two A5 pages side by side). I'd also like to present a Print Preview to my user so they can see how it will look.

With my current attempts at printing, I occasionally I get 'GDI error' whereupon the program aborts, and at other times my program currently prints a blank page (then works ok next time I press the print button).

Can anyone suggest any printing components or products that facilitate printing ? many thanks, Gazza

Comments

  • zibadianzibadian Posts: 6,349Member
    : I am writing a program that draws a grid on a page, into which a user can place clip-art, jpgs, wmfs, bmps, etc (selected from files on disk). I'm providing options like pre-filling the grid with background colours, placing text in the grid, etc. Most pics have to be re-sized or stretched to fit the grid size chosen by the user.
    :
    : But printing in Delphi seems to be a manual, messy business. I currently build my grid in a off-screen bitmap; I'd like to print it in a number of formats (perhaps as A4 - Port or Land, or two A5 pages side by side). I'd also like to present a Print Preview to my user so they can see how it will look.
    :
    : With my current attempts at printing, I occasionally I get 'GDI error' whereupon the program aborts, and at other times my program currently prints a blank page (then works ok next time I press the print button).
    :
    : Can anyone suggest any printing components or products that facilitate printing ? many thanks, Gazza
    :
    You can simply copy the Bitmap.Canvas onto the Printer.Canvas. Perheps you need to perform some scaling, but thats about it.
  • PerranPerran Posts: 241Member
    : I am writing a program that draws a grid on a page, into which a user can place clip-art, jpgs, wmfs, bmps, etc (selected from files on disk). I'm providing options like pre-filling the grid with background colours, placing text in the grid, etc. Most pics have to be re-sized or stretched to fit the grid size chosen by the user.
    :
    : But printing in Delphi seems to be a manual, messy business. I currently build my grid in a off-screen bitmap; I'd like to print it in a number of formats (perhaps as A4 - Port or Land, or two A5 pages side by side). I'd also like to present a Print Preview to my user so they can see how it will look.
    :
    : With my current attempts at printing, I occasionally I get 'GDI error' whereupon the program aborts, and at other times my program currently prints a blank page (then works ok next time I press the print button).
    :
    : Can anyone suggest any printing components or products that facilitate printing ? many thanks, Gazza
    :
    [b]I hate to say it[/b] [this is being written on a RedHat machine], but when I'm developing stuff for people I commonly use Word to handle printing chores. It's so ubiquitous that you can almost do it without asking, and it is pretty adept at printing in Windoze. My $0.02.
Sign In or Register to comment.