×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Printing in Landscape

Printing in Landscape

Printing in Landscape

(OP)
Can anyone assist with printing reports in landscape to a laser from Digital Unix?

RE: Printing in Landscape

Dave,
What problems are you experiencing?  Reporting RDL's or something else?  I have used different Unix systema and there appears to be no major differences with Digital Unix.  To print RDL's in Landscape you need to include the '-olandscape' option with the 'lp' command that is contained either in the printer.tbl file or in the unix command field on MSO016.  I hope this helps.
Paul.

RE: Printing in Landscape

Dave,
  Just using the -olandscape option results is (barely) usable output.  Can you send me your e-mail address and I will send you the script that we use to set the output string for better looking MIMS reports?  This script should be installed in the 'local' directory and called from the command line set up in MSO016.

Glen Colbert
 gcolbert@mslden.com
 

RE: Printing in Landscape

We use the following to define our printers. It seems like a lot of set up but works well once done.  This seems to give us better control over jobs than using unix printer driver files.

1. Print command in MSO016: lpr -Poma931l

2. Printcap entries: (Note oma931 is set to text and oma031l is redirected to it through the script in /usr/lbin)

oma931|OMA931:\
        :lf=/usr/adm/oma931err:\
        :lp=:\
        :rm=oma931:\
        :rp=text:\
        :sd=/usr/spool/oma931:\
        :sh:\
        :xf=/usr/lbin/xf:
oma931l|OMA931L:\
        :lf=/usr/adm/oma931lerr:\
        :lp=/dev/null:\
        :mx#0:\
        :of=/usr/lbin/oma931l:\
        :sd=/usr/spool/oma931l:\
        :sh:\
        :xf=/usr/lbin/xf:

3. /usr/lbin/oma931l contains:
#! /bin/csh
/bin/cat /usr/lbin/hplj13l - | lpr -Poma931

4. /usr/lbin/hplj13l contains PCL control codes (Each starts with esc) to set the print to landscape(&l1O), 8 lpi(&l8D), 13 cpi((s13H), 66 lines per page(&l66F), Top Margin 4 (&l4E), left margin 2 (&a2L)

I would like to see any other schemes as well.

Paul Durland
Kiewit Materials Co.

RE: Printing in Landscape

We have modified the "lpmims" Perl script supplied by Mincom.
The script accepts an additional optional argument, which tells whether to print portrait or landscape. Depending on the value of the argument, we send appropriate PCL printer control commands. As we only have one brand of printers, the script does not handle various brands.
Here are some notes taken directly from the script:

#  This script handles the following:
#  - formatting of report output according to report line size (80 or 132)
#  - forced landscape printing of reports listed in landscape.tbl, regardless
#    of the device id where requested to print
#  - optional portrait/landscape printing of any other reports, decided
#    by the user at request time by selecting an appropriate device id.
#    Additional devices can be set up in MIMS to enable optional landscape
#    printing. The device name should be self-explanatory, eg "printerid-land".
#  - landscape reports listed by landscape.tbl will print bold; any other
#    reports will print with the normal stroke weight.
#
#  The call to this script is entered in the "Unix Spool Command" field of
#  screen MSM016A - Maintain Device
#
#  The spool command specifies a printer queue(-d) and optional page orientatio\
n (-p)
#  If option -p is present, report is formatted according to the option:
#  landscape if the literal "land" is present, else portrait
#
#  If option -p is absent, script searches the report id in file
#  landscape.tbl that lists all reports that ALWAYS are required to print as
#  landscape.
#  landscape.tbl if implemented will need to stored in $MINENV_SYS/config
#  The situation is handled when landscape.tbl does not exist.
#
#  A report id listed in landscape.tbl will print landscape & BOLD in 2
#  situations: if option -pland is present on the commnad line, or if
#  option -p is absent. The report can still be printed portrait if
#  option -pport is present
#
#  Any other reports can be printed landscape & NORMAL if option -pland
#  is present. Note such reports cannot print bold.
#
#  If a report will print as portrait, formatting is undertaken
#  according to the number of characters in the report line (80 or 132).
#
#  The report line size and the report ID are determined by this script
#  from the first 5 rows of the printable file in STDIN.

Below is the section of code that determines the orientation:

local($normal_stroke)="0";
local($demi_bold)="1";

if ($landscape eq "land") {           # option passed in to print as landscape
  if (&rpt_in_list($report_id) == 1) {# report listed in landscape.tbl
    &land_print($demi_bold);
  }
  else {                              # report NOT listed in landscape.tbl
    &land_print($normal_stroke);
  };
}
elsif ($landscape ne "") {            # option was passed in and is not "land"
    &port_print;
}
elsif (&rpt_in_list($report_id) == 1) {# report listed in landscape.tbl
    &land_print($demi_bold);
}
else { #landscape.tbl does not exist or report not listed
    &port_print;
};


Below is the actual code for landscape printing for HP printers:

sub land_print {
  local($stroke_weight) = @_;
  #builds PCL commands for landscape printing
  #
  #orientation = landscape;
  print F_OUTFILE2 "^[&l1O";
  #
  #top margin = 3 lines;
  print F_OUTFILE2 "^[&l3E";
  #
  #lines per inch = 9 (expressed as VMI = 5.5)
  print F_OUTFILE2 "^[&l5.5C";
  #
  #left margin as number of columns: 5
  print F_OUTFILE2 "^[&a5L";
  #
  #stroke weight: medium (0) or semi-bold(1) depending on parameter
  print F_OUTFILE2 "^[(s${stroke_weight}b";
  #
  #Primary font: Courier
  #fixed (0p),upright(0s), 13char/inch(13h), Courier(4099T)
  print F_OUTFILE2  "^[(s0p0s13h4099T";
  #
}  #end of sub land_print
 
For more PCL language commands I suggest you search the HP site   

RE: Printing in Landscape

A simple way of controlling your prints from MIMS.

In /usr/local/bin two files, one named mimsprint-l (Landscape) and another named mimsprint-p (Portrait).  Content of mimsprint-l which is called via MOS016:
lp -d$1 -olandscape -o12 -olpi8 -onb -oA4 -otm3
and for Portrait:
lp -d$1 -oportrait -o12 -olpi8 -onb -oA4

So on the MSO016 line:
mimsprint-l Unix_queue_name

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close