Set margins on iSeries printer file

Elmer asks, "Is it possible to set margins for an AS/400 printer file like one would do with a MS Word document?" Example: Print starting 1 inch from the left edge and end printing 1 inch from the right edge. Is it possible? If so, how can he do it? -- Michelle Davidson, editor,

Answer Wiki

Thanks. We'll let you know when a new response is added.

Do you speak about PRTF or about a DEVICE ?

if PRTF, “simply” reorganize the DDS
if DEVICE, I assume you are using an ascii printer with faulty configuration for *WSCST.
in this case, first go back to updated WSCST.
This is possible if you have customized the WSCST in a previous version of the 400.

Discuss This Question: 6  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
    Check the Create Printer File (CRTPRTF) parameters. You'll find the the ones you're looking for, front margins and back margins, as well as a multitude of others which give you a very good control of the final output.
    0 pointsBadges:
  • specgrav
    I have set the margins to 0 in the CRTPF command till I turn blue, but I can not get page segments or overlays to print without offset. Any thoughts?
    20 pointsBadges:
  • azohawk

    CRTPF will create a physical (data) file, not a printer file. Perhaps you meant CRTPRTF?  In 20 years, I have never utilized the margin functions. I have modified the line per page, lines per inch, charaters per line and characters per inch. 

    In my source for the printer file I normally have on the 1st record "SKIPB(x)"  where x represent the line I want to start on. So if I am using 6 lines per inch and I want a 1/2 inch margin at the top I substitute 3 for x.  If I am using 10 characters per inch and want a 1.5 marign on the left, I put my first field starting in column 15 on record.

    In my first job (many many moons ago) we were creating data to fit on pre-printed forms for exporting (and every country had a differnt form).  We sometimes had to modify the characters per inch and lines per inch within the report. (i.e. we would print several lines a 6 char/inch, then some at 8 char/inch, then go back to 6 char/inch for the bottom of the report. I don't recall how we did that, but it is possible. 

    I might suggest that you look at a form tool. There are many out there. ACOM, RJS Software, Help Systems, ProHelp are among the leading providers in the areana (this is not an exahustive list). Or you can do your own. I have never done this, and back when I had to deal with forms I described, doing your own was not a viable option. But everywhere I have worked since, we have utilized some form tool.  The advantage of this is you can take pull the data from a spooled report (which tends to be rather rigid in placement of data) to exaclty (1/100th of inch or so) where you want it on the page.

    4,055 pointsBadges:
  • WoodEngineer
    I have used the OFFSET feature in a print file but that only applies to the left side of the page.  I am not aware of anything which will do what you want automatically.

    8,225 pointsBadges:
  • specgrav
    Yes, sorry.  Definitely meant CRTPRTF.

    A form tool may help, but I'm uncertain.  My problem isn't with character-printing.  It's with Page Segment printing. 

    Specifically, I have generated page segments and an overlay for a  form.  I have created them via the same AFP driver with the same settings (notwithstanding ovl vs pagseg).  The Overlay, I can generate within about a half an inch of the top and left margins, but the page segment has nearly an extra inch on each, and I can NOT figure out why.

    I cropped, set my page setup (in GIMP) and printed each to the AFP printer.  There are zero margins on either of them, yet, they behave differently in the code.

    R PSTEST                    PAGSEG(*LIBL/TESTPGS 0.0 0.0) 
    R OVTEST                    OVERLAY(*LIBL/TESTOVL 0.0 0.0) 
    20 pointsBadges:
  • WoodEngineer
    The code below is from a print files where we print a logo in the top left corner of the document.  By coding it as shown here we can change the logo on the fly based on the company's division ID.

    0127.00      A          R LOGO1                                                 
    0128.00      A                                      PAGSEG(&PSGNAM  .20 .25)    
    0129.00      A            PSGNAM         8A  P                                  
    0130.00      A* -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
    0131.00      A          R HEAD01A                   FONT(2304 (*POINTSIZE 10) ) 
    0132.00       *                                                                 
    0133.00      A            $DIVSN        32A     5  1FONT(761 (*POINTSIZE 12) )  
    8,225 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: