Board index » delphi » Printing text files

Printing text files

I have been printing text files in Delphi using the Assignprn and
Rewrite commands.  Everything works fine apart from being able to set
up the margins.  I have looked in the help files and Delphi
documentation, but cannot find any commands to set up the top, bottom
,left and right margins for the printed page.  I have got around the
problem of the left right margins by inserting spaces and tabs, but
I'm sure there must be an easier method of doing this.  Can anyone
help?

******************************************
Jim Blackstock, Bell College of Technology
Almada Street, Hamilton, ML3 0JB
Tel 0169 828 3100  Fax 0169 828 2131
work e-mail j.blackst...@bell.ac.uk
Home e-mail j.j.blackst...@strath.ac.uk
******************************************

 

Re:Printing text files


Quote
Jim Blackstock wrote:

> I have been printing text files in Delphi using the Assignprn and
> Rewrite commands.  Everything works fine apart from being able to set
> up the margins.  I have looked in the help files and Delphi
> documentation, but cannot find any commands to set up the top, bottom
> ,left and right margins for the printed page.  I have got around the
> problem of the left right margins by inserting spaces and tabs, but
> I'm sure there must be an easier method of doing this.  Can anyone
> help?

Instead of using AssignPrn(), use the TextOut function to write on
the canvas of the printer. You can specify the X and Y coordinates,
change the fonts, and much more. Check the TPrinter object in the
help files.

--
                            \\\|///
                          \\  ~ ~  //
                           (  @ @  )
************************-oOOo-(_)-oOOo-**************************************
Imran Hussain                            E-mail: imr...@ix.netcom.com
1 Executive Dr, Suite 130                Phone : (908)321-0340
Somerset, NJ 08820                       Work  : (908)469-4070
*********************************-Oooo.-*************************************
                        .oooO     (   )
                        (   )      ) /
                         \ (      (_/
                          \_)

Re:Printing text files


I found a component called lineprnt.zip on the net somewhere wich seems to take care of a lot of these things. I only had time to
have a quick look at it yesterday and haven't tried it in real life yet.
But it looks promising.

johan

Re:Printing text files


I found a component called lineprnt.zip on the net somewhere wich seems to take care of a lot of these things. I only had time to
have a quick look at it yesterday and haven't tried it in real life yet.
But it looks promising.

johan

Re:Printing text files


I've come across a component that lets you set the margins.  Look for
PgSetUp.zip at  http://www.pobox.com/~bstowers/delphi/
Good Luck

Jim Blackstock <j.blackst...@bell.ac.uk> wrote in article
<53vr1t$...@intsvr1.bell.ac.uk>...

Quote
> I have been printing text files in Delphi using the Assignprn and
> Rewrite commands.  Everything works fine apart from being able to set
> up the margins.  I have looked in the help files and Delphi
> documentation, but cannot find any commands to set up the top, bottom
> ,left and right margins for the printed page.  I have got around the
> problem of the left right margins by inserting spaces and tabs, but
> I'm sure there must be an easier method of doing this.  Can anyone
> help?

> ******************************************
> Jim Blackstock, Bell College of Technology
> Almada Street, Hamilton, ML3 0JB
> Tel 0169 828 3100  Fax 0169 828 2131
> work e-mail j.blackst...@bell.ac.uk
> Home e-mail j.j.blackst...@strath.ac.uk
> ******************************************

Other Threads