Different font style printing

greeshma

Member
Hi,
Is there any possibility to achieve different style in one singe page using progress.

def new shared stream report.
DEF VAR v-ans AS logi .
DEF VAR v-pg-length AS INT INIT 10 .
SYSTEM-DIALOG PRINTER-SETUP
NUM-COPIES 1
UPDATE v-ans.
output stream report to PRINTER NUM-COPIES 1
paged page-size value(v-pg-length) .
put stream report
skip(1)
"This is a tesdt report" at 01
"Report is here" at 10
skip(1).
output stream report close.

In the above code i want to print first line(This is a tesdt report) as bold with fontsize 12.
Second line (Report is here), as italic with font size 8.
 

LarryD

Active Member
Please enclose your code within code tags.

You will want to use PCL to set your bold and fontsize and whatever. There are a ton of web sites you can google to get the various PCL command definitions. Some commands are printer and/or manufacturer specific, but most modern printers support standard PCL 5 or PCL 6.

e.g. for a basic list of commands http://www.nefec.org/UPM/ccPCLfrm.htm

I'd suggest googling for "pcl command reference" to get some others that may fit your needs better.

For example, here is what you asked for (untested and note that you can combine various options):

Code:
def new shared stream report.
DEF VAR v-ans AS logi .
DEF VAR v-pg-length AS INT INIT 10 .
SYSTEM-DIALOG PRINTER-SETUP
NUM-COPIES 1
UPDATE v-ans.
output stream report to PRINTER NUM-COPIES 1
paged page-size value(v-pg-length) .
put stream report
skip(1).
put stream report control
      chr(27)
      "(s3B"  /* bold */
      "(s12V"  /* 12 point */ .
put stream report
"This is a tesdt report" at 01.
put stream report control
      chr(27)
      "(s0B"   /* back to normal */
       "(s1S"  /* italic */
      "(s8V"  /* 8 point */
put stream report
"Report is here" at 10
skip(1).
output stream report close.
 
Last edited:

greeshma

Member
Please enclose your code within code tags.

You will want to use PCL to set your bold and fontsize and whatever. There are a ton of web sites you can google to get the various PCL command definitions. Some commands are printer and/or manufacturer specific, but most modern printers support standard PCL 5 or PCL 6.

e.g. for a basic list of commands

I'd suggest googling for "pcl command reference" to get some others that may fit your needs better.

For example, here is what you asked for (untested and note that you can combine various options):

Code:
def new shared stream report.
DEF VAR v-ans AS logi .
DEF VAR v-pg-length AS INT INIT 10 .
SYSTEM-DIALOG PRINTER-SETUP
NUM-COPIES 1
UPDATE v-ans.
output stream report to PRINTER NUM-COPIES 1
paged page-size value(v-pg-length) .
put stream report
skip(1).
put stream report control
      chr(27)
      "(s3B"  /* bold */
      "(s12V"  /* 12 point */ .
put stream report
"This is a tesdt report" at 01.
put stream report control
      chr(27)
      "(s0B"   /* back to normal */
       "(s1S"  /* italic */
      "(s8V"  /* 8 point */
put stream report
"Report is here" at 10
skip(1).
output stream report close.

Thanks Larry :)
 
Top