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

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.