Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report file formatting 1

Status
Not open for further replies.

ThomVF

Programmer
Feb 8, 2001
270
US
Can anyone point me in the direction of figuring out how to set the font and font-size of a report file I am writing to ? This is not HTML, just straight ASCII output. I need to also set the page to Landscape, etc. Do I need to do this from a printer perspective or does Perl let me do it ?
 
Erm, perl only really handles the data involved, and straight ascii text files have no options to control how the text will be displayed or printed. these are controlled by auxilliary displaying/printing programs.

if you're saving them in a format other than plain text, to be later read by a program which has the ability to save extra pieces of data, like font or printing orientation, you can emulate the structure of that program's save files, and then include the necessary formatting options...

well, really, i'm pretty sure i don't know exactly what you're trying to do. are you outputting straight to a printer, or saving files to be used by a program and then possibly printed? and if it's the later, will the file saved be limited to only the actual data to be printed, or can format control flags be passed with it, to then be used by the printing script/program? "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
 
The later - I am saving formatted text to the file for visual review and future printing. I am allowed to stick the neceesary codes into the file without issue. My question is how to approach the insertion of codes (and are there generic codes (like \t for page-break) to set fonts and page-layouts...Thanks
 
Sorry - I meant "\f" for page-break....
 
I've never used it, but, on CPAN there is a POSTSCRIPT module that does this....

Code:
use PostScript::TextBlock;
    my $tb = new PostScript::TextBlock;
    $tb->addText( text => "Hullaballo in Hoosick Falls.\n",
                  font => 'CenturySchL-Ital',
                  size => 24,
                  leading => 26
                 );
    $tb->addText( text => "by Charba Gaspee.\n",
                  font => 'URWGothicL-Demi',
                  size => 12,
                  leading => 14
                 );
    print 'There are '.$tb->numElements.' elements in this object.';
    open OUT, '>psoutput.ps';
    my ($code, $remainder) = $tb->Write(572, 752, 20, 772);
    print OUT $code;


Maybe it will do some of what you are looking for.
See =>
HTH



keep the rudder amid ship and beware the odd typo
 
Thanks for the input - I have decided to use PCL commands with Printf to the file - the customer uses all HP printers so I guess this will work smoothly - Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top