Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printing with Java on a AS/400 system

103 views
Skip to first unread message

Tobias Priebs

unread,
Dec 7, 2011, 9:39:26 AM12/7/11
to
Hello,

ich have the problem to print reports with java directly from a AS/
400 system.
Currently I create a SpooledFiledOutputStream, on this stream I create
a AFPDSOutputStream.
In this stream I read a AFP-File in.

PrintParameterList parms = new PrintParameterList();
parms.setParameter(PrintObject.ATTR_OUTPUT_QUEUE,
queue.getPath());
parms.setParameter(PrintObject.ATTR_SRCDRWR, 2);
// parms.setParameter(PrintObject.ATTR_POINTSIZE , "1");

SpooledFileOutputStream spooledOut = new
SpooledFileOutputStream(system_,parms, null, null);

AFPDataStream afpStream2= new AFPDataStream();
afpStream2.startDocument(spooledOut);
afpFile = new File( "C:/AFPServer/graustufen.afp");
spooledOut.write(getBytesFromFile(afpFile));

afpStream2.endDocument();

outPutQueueList.close();
out.close();
System.exit(0);



My problem is that the gray levels are not printed correct. The geray
level get to fast to dark, so that the most pixels are black. I think
that the resolution or the raster is not fine enough.
Does somebody where I can solve the problem?
Does somebody now where i can change the settings for gray levels on
the AS400?

I'm really thankful for every hint.

Kind regards,
Tobias

Dr.Ugo Gagliardelli

unread,
Dec 7, 2011, 10:36:37 AM12/7/11
to
il 07.12.2011 15:39, Scrive Tobias Priebs 109177312:
> Hello,
>
> ich have the problem to print reports with java directly from a AS/
> 400 system.
> Currently I create a SpooledFiledOutputStream, on this stream I create
> a AFPDSOutputStream.
From which package does this class come from?
> My problem is that the gray levels are not printed correct. The geray
> level get to fast to dark, so that the most pixels are black. I think
> that the resolution or the raster is not fine enough.
> Does somebody where I can solve the problem?
> Does somebody now where i can change the settings for gray levels on
> the AS400?
It's not matter of AS400, but the way the printer is configured. Grey
levels colors and resolution are chosen specifying an IMGCFG in the
printer configuration. Usually the IMGCFG should match the phisical
printer characteristics, but you can sapecify a different one. For
example: assume you have a 600-dpi HPPCL printer, in the printer
configuration, IMGCFG parameter, you should specify *IMGA05 for a color
printer or *IMGA02 for a b/w one. But you are free to specify *IMGA01,
that's for a b/w 300-dpi, and will have a mismatch at print time.
Look at the help for IMGCFG parameter in CHG/CRTDEVPRT command, there's
a long list of printers with the configuration name suggested.

There's a PrintObjetc.ATTR_IMGCFG option too, but I'm not sure where you
can use it.

Tobias Priebs

unread,
Dec 8, 2011, 4:37:29 AM12/8/11
to
On 7 Dez., 16:36, "Dr.Ugo Gagliardelli" <do.not.s...@me.please> wrote:
> il 07.12.2011 15:39, Scrive Tobias Priebs 109177312:> Hello,
>
> > ich have the problem to print reports with java directly from a AS/
> > 400  system.
> > Currently I create a SpooledFiledOutputStream, on this stream I create
> > a AFPDSOutputStream.
>
>  From which package does this class come from?>

The AFDPSOutputStream comes from fop.0.95.


> >My problem is that the gray levels are not printed correct. The geray
> > level get  to fast to dark, so that the most pixels are black. I think
> > that the resolution or the raster is not fine enough.
> > Does somebody where I can solve the problem?
> > Does somebody now where i can change the settings for gray levels on
> > the AS400?
>
> It's not matter of AS400, but the way the printer is configured. Grey
> levels colors and resolution are chosen specifying an IMGCFG in the
> printer configuration. Usually the IMGCFG should match the phisical
> printer characteristics, but you can sapecify a different one. For
> example: assume you have a 600-dpi HPPCL printer, in the printer
> configuration, IMGCFG parameter, you should specify *IMGA05 for a color
> printer or *IMGA02 for a b/w one. But you are free to specify *IMGA01,
> that's for a b/w 300-dpi, and will have a mismatch at print time.
> Look at the help for IMGCFG parameter in CHG/CRTDEVPRT command, there's
> a long list of printers with the configuration name suggested.
>
> There's a PrintObjetc.ATTR_IMGCFG option too, but I'm not sure where you
> can use it.

I will try it with the IMGCFG. At the first view it seems to be a good
idea.
Thank you for the idea.


Tobias Priebs

unread,
Dec 12, 2011, 8:12:37 AM12/12/11
to
I try to set the IMGCFG in the device parameters, but nothing changed.
The printing result is allways the same.
Are there special combinations which have to be set?
I try a few ImageConfigurations but there was no difference between
any of some.
It seems to me, that the configuration is not applied.
0 new messages