domenica 2 novembre 2014

Honey, my AFP prints shifted.

II'll put this post here as a reminder for me and for whom has to deal with it:  the AFP prints shift. You have your print and you say: "Good, let's try it in *AFPDS, won't it be the same?". You'd compile your good old PRTF
like this:
CRTPRTF FILE(LIB/PRTF) DEVTYPE(*AFPDS)
and you'd print it. Some field shifted, others didn't. Ok, let's try it in PDF. Correct.

(average user reaction)

Flipping the tables like our friend RageGuy is not needed! The design of the Host Print Transform API (info) is to be "blamed" for all of this. In order to keep compatibility with IPDS systems, it shifts all the fields that fall into the unprintable borders of the sheet! That is well described in this article of the Support site.

For example, we could have this printer configuration:
CHGOUTQ OUTQ(QUEUE) TRANSFORM(*YES) MFRTYPMDL(*HP5)
We are teaching the system to use the HPT function in order to print on a PCL5 compatible printer, this kind of configuration sets the unprintable borders at 1/6 of an inch top and bottom and 1/4 of an inch left and right.
Those values are fixed into the terminal personalization object called QSYS/QWPHPLSR5 that corresponds to *HP5, the PDF transformation uses another personalization: that explains the different output!

You may say: "You know, my (laser) printer doesn't have UNPRINTABLE borders!" And I'd respond: "LOL! Yeah, and I climb mountains using a single finger like Manolo!". If you really insist on reducing the margins, you can set up a personalization object starting from *HP5 (for example).

Note: the margins are wide, guess why? To grant compatibilty with a vast number of printers.

(Compatibility is the favourite word of  Big Blue - isn't it?)

Even if you personalized your terminal, you could still be having this repositioning: text field or graphic, if they are located in the unprintable area they are "gently" moved to the printable area.
In order to solve this situation, the Support Site suggests three ways, let's see them.

  1. Move all the fields in the printable area


That is the "your problem" solution: armed with a graded ruler, you can easily perform calculations: if you print 15 CPI with 1/4 of an inch of unprintable border, the first printable column is the fifth.

Characters per Inch
(CPI) Value
Unprintable Border
in CPI
Earliest Starting
Column
5
5 / 4 = 1.2
3
10
10 / 4 = 2.5
4
12
12 / 4 = 3
4
13.3
13.3 / 4 = 3.325
5
15
15 / 4 = 3.75
5
16.7 o 17.1
16.7 / 4 = 4.175
6
18
18 / 4 = 4.5
6
20
20 / 4 = 5
6

Clearly, moving all the initial fields could mean refactoring the entire print...

  2. Change the FRONTMGN parameter


It's the best solution, pratically you'd set the margins of *HP5 in the print itself. This way you'll move all the fields of the print and you won't let the HPT function do what it wants; you can add this parameter during the creation or like a substitution:
CRTPRTF FILE(LIB/PRTF) FRONTMGN(0.17 0.25) UOM(*INCH)

CHGPRTF FILE(LIB/PRTF) FRONTMGN(0.17 0.25) UOM(*INCH)

OVRPRTF FILE(PRTF) FRONTMGN(0.17 0.25) OVERSCOPE(*JOB) 
        UOM(*INCH)

Please note that the unity of measure parameter (UOM) is set on inches. If instead you want to use centimeters you could go like this:
CRTPRTF FILE(LIB/PRTF) FRONTMGN(0.43 0.64) UOM(*CM)

CHGPRTF FILE(LIB/PRTF) FRONTMGN(0.43 0.64) UOM(*CM)

OVRPRTF FILE(PRTF) FRONTMGN(0.43 0.64) OVERSCOPE(*JOB) UOM(*CM)

  3. Printing in raster mode


That is the "meh" solution: you can set up a terminal personalization by setting the raster mode on, in the section:
:RASTERMODE
 SCS=NO
 AFP=NO.
change this fields
 SCS=YES
 AFP=YES.
With this configuration, you make the HPT function treat everything as graphic, translating even the character fields as bitmap (that's it, rasterizing), what will it imply?

- the fields in the unprintable borders won't be shifted but cropped,
- the resulting spool file is larger and the printing production slows down,
- you should install a couple of options in order to grant the compatibility with all the fonts (AFP Compatibility Fonts - IBM AFP Font Collection for IBM Operating System - Advanced Function Printing DBCS Fonts/400),
- if you have a tool that translates from PCL to PDF (one above all: GhostPDL), the text won't be selected.

...seriously!?

IBM makes available additional terminal personalizations (download the SAVF), some of them have the raster mode activated (like PCL5RASTER), and some other type and models (MFRTYPMDLs) with the raster mode are already installed in the system: *IBM4076, *HP310, *HP320, *HP500, *HP520 and *HP540.

In conclusion, create your printer files with:
CRTPRTF FILE(LIB/PRTF) FRONTMGN(0.17 0.25) UOM(*INCH)
And here you go!


P.S.: if you don't know, AFPDS is the graphic format made available by IBM, OS integrated.
You can do a lot of good things like changing fonts, inserting barcodes, impressing images and graphics to the prints, all this using keywords in the printer file (Did I say that it is integrated?).

http://afpcinc.org/
 (There is a Consortium that promotes it.)

(Bwahahaha! I found this on Google Images, it brings here, ask me nothing.)

Nessun commento:

Posta un commento