Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Dump a Text with Graphics directly into the Printer.

edited February 2006 in General
Dear All !

I have a situation here where I need to print various .TXT files which
has graphical characters i.e Alt+.., in it. All What I need is select
the file print it after adjusting the font size. Please Help !


Thank You

Thatchi
~~~~~~~~~

Comments

  • edited February 2006
    Hi Thatchi,

    If you are just send .txt files to the printer, you may be able to simply
    use the built in Delphi TPrinter object and leave ReportBuilder out of the
    process.

    -----------------------------------------------
    Tech Tip: Send TextFile to Printer
    -----------------------------------------------

    I designed a application that exports the report to a .txt
    file using ReportTextFile device.

    How can I Send the text file to the printer?

    The following procedure will send the .txt file to
    the printer using Delphi's TPrinter object.



    uses
    Printers;


    procedure SendTextFileToPrinter(aFileName: String);
    var
    lsLines: TStringList;
    lOutputFile: TextFile;
    liIndex: Integer;
    begin

    lsLines := TStringList.Create;

    try
    lsLines.LoadFromFile(aFileName);

    AssignPrn(lOutputFile);
    Rewrite(lOutputFile);

    for liIndex := 0 to lsLines.Count-1 do
    Writeln(lOutputFile, lsLines[liIndex]);

    CloseFile(lOutputFile);

    finally
    lsLines.Free;
    end;


    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2006
    Nico Cizik (Digital Metaphors) wrote:

    Thanks Nico !

    But my problem is actually to change the FONT SIZE of the whole text
    file, and then send it to the printer, is that possible ?

    Thatchi
    ~~~~~~~~~~~
  • edited February 2006
    Hi Thatchi,

    Sending a text file to the printer is not a native feature of ReportBuilder,
    however I do believe it is possible to assign a font and send a text file to
    the printer using the TPrinter object in Delphi. It should just be a matter
    of assigning a font to the printer canvas, then drawing the text to that
    canvas before printing. Take a look at the TPrinter topic in the Delphi
    help for more information.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.