• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3940
  • Last Modified:

Printing AS400 report in AS400 portrait mode on a HP laserjet that is setup for landscape

AS400 OS VR5R3   We are running an RPG400 program which outputs a file to  to a HP III Laser Jet Printer which is configured as an LPR printer with IP address.

By default the printer is prints output from the AS/400 in  A4/landscape mode.

I want the output for this program to print  in A4/portrait mode.

Below find some details about the spoolfile and printer file.


Here is some of the information from the spool file.
                                                         
 Page range to print:                                    
   Starting page  . . . . . . . . . . . :   1            
   Ending page  . . . . . . . . . . . . :   *END          
 Record length  . . . . . . . . . . . . :   80            
 Page size:                                              
   Length . . . . . . . . . . . . . . . :   66            
   Width  . . . . . . . . . . . . . . . :   80            
   Measurement method . . . . . . . . . :   *ROWCOL      
 Lines per inch . . . . . . . . . . . . :   6            
 Characters per inch  . . . . . . . . . :   10            
 Overflow line number . . . . . . . . . :   60            
 Fold records . . . . . . . . . . . . . :   *NO          



Here is some of  the information about the program printer file

   Page size                                     PAGESIZE                  
     Length  . . . . . . . . . . . . . . . . . :                 66        
     Width . . . . . . . . . . . . . . . . . . :                 80        
     Measurement Method  . . . . . . . . . . . :            *ROWCOL        
   Lines per inch  . . . . . . . . . . . . . . : LPI        6              
   Characters per inch . . . . . . . . . . . . : CPI        10            
   Front margin  . . . . . . . . . . . . . . . : FRONTMGN   *DEVD          
   Back margin . . . . . . . . . . . . . . . . : BACKMGN    *FRONTMGN      
   Overflow line number  . . . . . . . . . . . : OVRFLW      60            
   Fold records  . . . . . . . . . . . . . . . : FOLD       *NO            
   Degree of page rotation . . . . . . . . . . : PAGRTT     *AUTO          
   Hardware justification  . . . . . . . . . . : JUSTIFY      0            
   Print on both sides . . . . . . . . . . . . : DUPLEX     *NO            
   Defer Write . . . . . . . . . . . . . . . . : DFRWRT     *YES          
   Unprintable character action                  RPLUNPRT                  
     Replace character . . . . . . . . . . . . :            *YES          


0
mf999
Asked:
mf999
  • 2
  • 2
1 Solution
 
daveslaterCommented:
Have you set the page rotation to *COR?

dave
0
 
mf999Author Commented:
Hi Dave
Thanks for your reply.
I just recreated the print file and set the page to *COR as you suggested. The output is still the same, the print is in landscape mode rather than portrait.  Any other ideas?
mark
0
 
tliottaCommented:
Mark:

The A4 physical page size is barely within the page length/width you have set. If there is any unprintable margin area for the device, it's unlikely that 66 lines and 80 characters can fit in portrait. You might need to either reduce the length/width or _possibly_ use PAGERTT( 0 ). Without rotation, you might lose printed data.

Perhaps you could reduce the font pitch.

Tom
0
 
mf999Author Commented:
Thanks for the feedback.  Changing the Pagertt to 0 did the trick.   Just wondering what size lines and characters would you recommend as being a standard A4 size?
0
 
tliottaCommented:
Mark:

*A4 is given as 210mm x 297mm. That comes to approx 8.27 x 11.69 in., not quite an exact match for normal *LETTER 8.5 x 11 in. stock. It's 2/3 of an inch longer, but a 1/4 inch narrower.

Now, consider that there might be physical nonprintable margins defined by the printer. Perhaps a half inch on the top and bottom and a half inch on the left and right sides. Or maybe the printer has no physical print margins at all, or somewhere between those two. Only your printer manual will tell you if physical margins exist and what they are, or if logical margins can be and/or have been set, and how to find out what those are.

With 8 1/4 inch physical page width and 1/4 inch margins left and right, at 10 CPI the maximum number of characters in a line with a fixed-pitch font would be 77 characters.

[((8.25 - (.25 + .25))=7.75)*10=77.5=~77]

Once you know of any margin requirements, the printable page area can be described in terms of printable width and length, number of characters per line (CPI) and number of lines per page (LPI). The font pitch can be adjusted to fit a different number of characters into a line. Variable pitch fonts can also make a difference.

As you can guess, there are numerous details that can affect any final determination. Any detail could be tweaked to make a difference.

An important item to keep in mind is that an externally described printer file (a *FILE object with PRTF attribute) is used by a running program. The program uses the PRTF to know what kinds of control characters to insert into the spooled file to result in the eventual physical output and other elements of the data stream. Once the spooled file is created, most of the PRTF attributes can't be changed in useful ways. If spooled output doesn't work on a given printer, it is quite likely that it needs to be recreated after adjusting the PRTF attributes or overriding them during regeneration. If any override is used regularly, it probably is best simply to create a new PRTF that incorporates that override.

Tom
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now