Recent

Author Topic: printing stuff  (Read 802 times)

pentilisea

  • Guest
printing stuff
« on: March 22, 2023, 07:38:12 pm »
Hu guys,
stuck again awefully dispite googling the printer stuff.

I've got the printer dialog:
Code: Pascal  [Select][+][-]
  1. if PrintDialog1.Execute then

I've got a small png file about 75k bits.
Code: Pascal  [Select][+][-]
  1. Image1.Picture.LoadFromFile('savegrid.png');

How do I bring both together so the pic gets printed on the standard printer?

I looked at a lot of printer stuff with complicated setting - my guess: shouldn't be done with long code pages and printer/doc settings....

Hmm, seems I'm keeping you busy, will try to not post any stupid too basic stuff.....

Any help apreciated.
Klaus
« Last Edit: March 22, 2023, 07:41:12 pm by pentilisea »

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2006
  • Fifty shades of code.
    • Delphi & FreePascal
Re: printing stuff
« Reply #1 on: March 22, 2023, 09:08:34 pm »
You should read this.
If I had a printer I would create a small demo but unfortunately I haven't anymore.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

pentilisea

  • Guest
Re: printing stuff
« Reply #2 on: March 22, 2023, 09:40:55 pm »
Hi Mr. Zwerg,
thanks fo far. Already have this link looked at. But haven't yet figured out how to implement it as it is not dealing with PrintDialog.

I need a simple solution, as nothing else will be printed in the app as .png of a small size.

The other Load and Safe file Dialogs are pretty easy to use so I would expect not to fumble around with paper size, margins ....
The components of the PrintDialog seam to not have a print.image or somethiong like this...... or using the OS provided
printer settings...

Will poke around and see what works....

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: printing stuff
« Reply #3 on: March 22, 2023, 10:35:51 pm »
Here is a small project for you, it should work (I tested on Windows).

pentilisea

  • Guest
Re: printing stuff
« Reply #4 on: March 24, 2023, 02:51:22 pm »
Here is a small project for you, it should work (I tested on Windows).

Hi WP,
works like a charm and gets me started ...

Klaus

 

TinyPortal © 2005-2018