PJL command to set orientation

2k Views Asked by At

I have tried setting the number of copies using PJL and got it working. However I could not get the @PJL SET ORIENTATION=LANDSCAPE working. It always prints in Portrait. I am also looking for options to print particular page range say from page 2 to 5. Can this be achieved using PJL? I am using the printer HP LaserJet 5000 Series PCL6.

3

There are 3 best solutions below

0
On

Your postscript code likely has the orientation command which is overriding your PJL command. In your postscript code, look for something like this, as it's the thing that will rotate the page to landscape:

90 rotate

For example, I'm using this code to go landscape in postscript:

% get pagesize from device or default to letter
/pageSize {
  currentpagedevice /PageSize known {
    currentpagedevice /PageSize get
  } {
    612 792 2 array astore
  } ifelse
} def

% go landscape
90 rotate 0 pageSize aload pop pop neg translate
1
On

I am able to achieve page range using the command, @PJL JOB NAME="TestPage" START=2 END=5. It works. Modfying the orientation does not work.

0
On

This most likely cannot be done with PJL in your case. The datastream probably contains a command for orientation. PJL is designed to provide access to features that are not native to the datastream used, provides a solution for explicit language selection, allows for feedback from the printer and other job related items.

Your best solution is to parse the output and make the change inline. You might be able to do this with a 3rd party solution like Ghostscript by splitting the document into sections for portrait and landscape, having it rotate for you, and then piece the file back together again.

Other options might include using a language such as PCL5 where it might be easier to modify the data inline.