Operating System - OpenVMS
1753789 Members
7826 Online
108799 Solutions
New Discussion

Re: how to print in landscape

 
SAMI AHMAD
Regular Advisor

how to print in landscape

i have two questions:

 

1- how can i print in landscape format in openVMS ?

 

2- how can i (if possible) add page breaks or heading during printing . basically i want to print only 60 lines/page .

 

thanks

8 REPLIES 8
Bob Blunt
Respected Contributor

Re: how to print in landscape

What version of OpenVMS

What hardware architecture

What printer manufacturer

What type printer

What printer model

What software FOR the printer, version included

How is the printer connected, physically?

What type queue is driving the printer

 

Those are just the preliminary questions.  There's not even enough in the question to guess at an answer.

 

bob

John Gillings
Honored Contributor

Re: how to print in landscape

Sami,

 

   I'm not a big fan of printing at all. I'm even less of a fan of the very old, clunky and opaque printing infrastructure on OpenVMS (with due respect to Paul A, much like my respect for folk who still know their way around a Model T Ford ;-).

 

  For my money, you print anything from OpenVMS by transferring the file to your favourite desktop operating system and printing it from there.

 

Case in point, it should NOT be necessary to get the answer to a pageful of "preliminary questions" just to answer something as fundamental as specifying the orientation of the print job.

 

The answer should be more like "click the LANDSCAPE button in the standard printer dialog box"

A crucible of informative mistakes
Phil.Howell
Honored Contributor

Re: how to print in landscape

SAMI AHMAD
Regular Advisor

Re: how to print in landscape

What version of OpenVMS  -  7.3-1

What hardware architecture   alpha

What printer manufacturer  - HP

What type printer -  laser 

What printer model  -  HP9050

What software FOR the printer, version included  - UNKNOWN

How is the printer connected, physically?  - via ethernet  .

What type queue is driving the printer - print que

 

Printer queue HP_COMMON, idle, on PASY::"10.100.13.10:9100",

mounted form DEFAULT

  <TDC 2nd flr RM 248>

  /AUTOSTART_ON=(PASY::"10.100.13.10:9100") /BASE_PRIORITY=4

  /DEFAULT=(FORM=DEFAULT) Lowercase /PROCESSOR=TCPIP$TELNETSYM

  /SEPARATE=(RESET=(RESET))

  Access to security information denied.

P

SAMI AHMAD
Regular Advisor

Re: how to print in landscape

further more  this library which i see being mentioned in the link MC_HP$DEVCTL   is not present on our system.

is this library optional ?

Bill Hall
Honored Contributor

Re: how to print in landscape

The easiest solution, if you've never created a device control library and don't have one for the HP9050, would be to install and configure "HP DECprint Supervisor for OpenVMS (DCPS)" product.  IIRC the license for it should be included with the version of VMS that you are running.  DCPS will produce better looking output with much less work on your part than creating a device control library from scratch for the HP9050 (thanks to Paul A.)

 

After installing and configuring DCPS,  to print my_file.lis to queue my_queue in landscape:

 

$print  my_file.lis /queue=my_queue /parameter=(page_orientation=landscape)

Bill Hall
Bob Blunt
Respected Contributor

Re: how to print in landscape

The device control library usually has the commands that should be sent to the printer to get it to do something...like change to landscape mode...

 

I'm not familiar with the 9050, does it have native PostScript and does it communicate bi-directionally (which are the main things that DCPS wants SUPPORTED printers to do)?  I think that DCPS uses a "raw" IP connection to printers that are on the Ethernet instead of TELNET symbiont or some other variant.  Basically if you can TELNET to your printer's IP address port 9100 then it could work with DCPS.

 

You could check $ PROD SHOW PROD or PROD SHOW HISTORY to see if DCPS was loaded and also check in SYS$STARTUP for DCPS$STARTUP but it doesn't really look like that printer was setup using any of the DCPS command procedures.  Unless the printer is obviously setup to use/provide PostScript by default (either native or from a personality chip sort of thing) then switching to landscape may not be as easy.  Most HP LaserJet printers I've experienced will usually print plain ASCII even if they're not PostScript-based but their normal "real" language is usually PCL or something like it.  Your device control library would have to have the necessary "commands" in the printer's native tongue to make that change through software.

 

And it isn't always guaranteed that there's a magic "landscape" printer button on the printer.  Most of the printers I've used on OpenVMS-based systems either have to make that switch with a software command or you have to go through a stepped series of menus on the printer setup on it's "front" panel.  Making that sort of change doesn't always happen easily.  My "20 questions" about your environment were an attempt to discover if you had, among other things, DCPS and how the printer connected.

 

bob

PJSeder
Regular Visitor

Re: how to print in landscape

John G was correct, you shouldn't need a lot of preliminary questions, and in this case, you don't. You just need to know if the printer supports PCL (Printer Control Language) and I can't think of one that DOESN'T these days.

 

Although the DCPS option would certainly work, it's (comparatively) a lot of extra work. The most direct solution, IMHO, is to create a form with the required PCL commands embedded, and insert it into your device control library. Believe it or not, it will probably take more time to read this post than it will to perform the tasks required. :)

 

If you just want the answer, scroll down to the ***SUMMARY*** below; if you want to know how to do it, read on. :)

 

BTW, to answer your question about MC_HP$DEVCTL; that is a site-specific library, and is not part of the OS. SYS$LIBRARY:SYSDEVCTL.TLB is the default device control library for OpenVMS.

 

Your queue definition for HP_COMMON contains a reference to a RESET module, so SYS$LIBRARY:SYSDEVCTL.TLB should already exist (and contain RESET), but if it doesn't, here is how we create it:

 

          $ LIBRARY /CREATE /TEXT SYS$COMMON:[SYSLIB]SYSDEVCTL.TLB

 

For sites that print to many different types of printers (HP, Xerox, etc), an Admin might create a separate device control library for each brand (i.e. HP_DEVCTL.TLB), but since we're doing some fairly generic stuff here (and most PCL is universal anyway), we'll just use the default library.

 

Next, we need to create a device control module (form) that goes into the library. The module is basically a text file that contains escape sequences ( PCL codes). The module gets sent to the printer ahead of the file to be printed.

 

There are different ways to create escape characters (which you can research elsewhere), but I've always had problems with <ESC>  using TPU, so I use EDT for this task. Since the name of this file will become the name of the module, let's make it meaningful.

 

          $ EDIT /EDT (/NOCOMMAND) SYS$SCRATCH:LANDSCAPE.TXT

 

(Enter C at the "*" for "change" mode...now we're rolling OLD skool! :))

 

Add the following code (for landscape)

           <ESC>\<ESC>&l1O<ESC>\

(In EDT, use ^[[ (control+leftbracket+leftbracket) to create the <ESC> character)

Save the file (Ctrl-Z-->Exit)

 

Now that we've created the module, let's insert it into the library:

         

          $ LIBRARY /INSERT /TEXT SYS$LIBRARY:SYSDEVCTL SYS$SCRATCH:LANDSCAPE.TXT

 

And you can confirm it with the command:

 

          $ LIBRARY /LIST /FULL SYS$LIBRARY:SYSDEVCTL.TLB

 

The form is now in the library and available for use. We can either specify the form on the fly (as a qualifier of the PRINT command), or we can tie the form to the queue permanently (or created a parallel, dedicated LANDSCAPE queue for this printer)

 

To print on the fly:

 

          $ PRINT /QUE=HP_COMMON /FORM=LANDSCAPE file.txt

 

To set up a dedicated queue, copy the HP_COMMON queue definition commands to something like HP_COMMON_LAND, and add the following qualifier to your INIT/QUE command:

 

          /FORM=LANDSCAPE /DEFAULT=(FORM=LANDSCAPE)

 

You also asked how to print 60 lines per page. Now that you have the basics of adding a form to the device control library, you simply need to create a new text file (i.e. HP_60LINES.TXT) with this escape sequence:

 

           <ESC>\<ESC>&l60P<ESC>\

 

And insert it into the library as described above.

 

There is a HUGE amount of manipulation/formatting you can do to an OpenVMS report, via PCL commands, from setting verticle line spacing (Lines Per Inch), Lines Per Page, Orientation, Tray Selection, Margins, Font Selection, Colors and Patterns, Duplexing (on printers that have one)...you name it.

 

There are many PCL Code resources out there...here's the one I tend to use most:

 

http://pcl.to/reference/


**Summary**:

 

So to sum it all up...here are all the commands again:

 

          1) Create the form (text file)
                     - Add the appropriate code (and they can be combined, but sequence matters)
          2) Insert your new form:
                     $ LIBRARY /INSERT /TEXT SYS$LIBRARY:SYSDEVCTL SYS$SCRATCH:LANDSCAPE.TXT
          3) Use your form (via PRINT)
                    $ PRINT /QUE=HP_COMMON /FORM=LANDSCAPE file.txt

 

Hope this helps!

 

John