× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello Mitch,

Personally, when I have problems like this, I prefer to try doing things one step at a time to see where they break, and what sort of information I can get.

Consequently, I'd set up my outputcommand to look like this:

outputcommand=cat - > /home/myuserid/test.scs

The idea is that lp5250d will write the raw SCS data to a file in your home directory. Then I'd run:

cat test.scs | scs2ascii > test.asc

And

cat test.asc | enscript -B -f Courier7 --margins=36::36: -r
--output=- > test.ps

cat test.ps | gs -q -dNOPAUSE -dBATCH -sDEVICE=tiffg4 -r300
-sOutputFile=/home/user/test.tiff - > test.tiff

You'll note that I used 'cat' to send the file to each program, so that it's reading the data from a pipe, the way it would be if you were using it in production. I also used > to direct it to a file for the same reason.

This way, you can see any messages printed to stderr at each step of the way, and hopefully see where things are going wrong, and correct them, etc. And since you have a file at each step of the way, you can repeat each test with different options, if needed.

If you still can't get this to work, I'd suggest creating the TIFF on the System i, and just using lp5250d to download it to the Linux box. That should be extremely easy to do...

tiff {
host = systemi.example.com
env.DEVNAME=TIFF
env.IBMMSGQNAME=QSYSOPR
env.IBMMSGQLIB=*LIBL
env.IBMMFRTYPMDL=*WSCST
env.IBMWSCSTNAME=QWPTIFFG4
env.IBMWSCSTLIB=*LIBL
outputcommand=scs2ascii>/home/myuserid/test.tiff
}

The trouble you'll have with this 2nd method is tuning all of the parameters (page size, size of each character, etc). Those tunings need to be made in the individual print files, and a lot of people aren't willing to undertake the process of changing all of their print files (despite that this is the way that OS/400 was designed to work). It's enough to make you want to chew your own foot off.

But, that would be the advantage to your enscript/gs solution, if you can get it working... you wouldn't have to adjust all of the print files.
I don't understand why James suggested adding quotes. Seems to me that the quotes he suggested are pretty much guaranteed to make the process fail, because it completely changes the meaning of the string.
Mitch Martin wrote:
I think this should work, but you probably need to use double quotes
like
this:

outputcomand = scs2ascii | "enscript -B -f Courier7 --margins=36::36: -r
--output=- | gs -q -dNOPAUSE -dBATCH -sDEVICE=tiffg4 -r300
-sOutputFile=/home/user/test.tiff -"

Try that and let me know if it fixes it for you.

If that doesn't work I can look at scs2ps and see what needs to be done
to get it to output better postscript. I think that it has just been
sort of ignored and can be improved without too much effort.

------------
---

Hello James,

Thank you for taking your time to look at my problem. Unfortunately, I
still have the same issue. I am testing this on a non-production server
with only one device in the .tn5250rc file. The name of the device is
"tif_file". When I start the device, I get the following output on the
console screen:

Starting lp5250d tif_file...
/home/user/.tn5250rc: Success

I don't want to take up your time but if you have any other suggestions,
I would greatly appreciate them. In the meanwhile, I'm thinking of
trying to learn enough bash scripting to maybe send the output of
scs2ascii to a script that would check the file for line length with wc
and use that info to determine if I need to rotate the page or not with
enscript and then use ghostscript for processing the tiff. If you have
any thoughts regarding that idea, feel free to comment.

One more item... What would be a good way to monitor the lp5250d
processes and restart them should the network link be broken or the
server gets IPL'ed? I miss that feature from Client Access. ;)

Thanks again for your help.

Regards,
Mitch




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.