News Shareware IServices Resellers Projects Partnerships
MPEiX: convert spoolfiles to PDF? by
Mark Bixby

Spoolfiles are a special MPE filetype used to send output to printers. The format of their records is documented in the "Spool File Block Format (SBF)" chapter of: http://docs.hp.com/mpeix/pdf/32650-90867.pdf

The format is EXTREMELY unfriendly to process manually. I once wrote a program to transfer spoolfiles to an IBM printing subsystem, and it was really, really painful to process P1, P2, and the CCTL byte correctly in order to produce printed output the same way it would appear if printed on an MPE printer.

MPE uses special carriage control bytes (CCTL) that determine line spacing, page ejects, etc. It's not simply a matter of inserting multiple NL characters for double or triple spacing or inserting a single FF character for a page eject.

When MPE users ask "Can I convert my spoolfiles to PDF?" they mean they want to preserve the CCTL information. I.e. if the spoolfile would print double spaced, they want the PDF to appear double spaced.

Spoolfiles are a native MPE file format, and Perl is a POSIX program. When POSIX was added to MPE, a new POSIX bytestream file format was created, and behaves just like it would on a Unix system. However, you can still access native MPE files through POSIX I/O functions, and when you do this, the MPE files are emulated to look like POSIX bytestream files. But since MPE files may sometimes have attributes that don't exist on POSIX, you lose the abilities to even see these attributes if you're using the POSIX API.

Unfortunately for spoolfiles, you aren't able to see the P1, P2, and CCTL values while using the POSIX API that Perl uses for its I/O, and since P1, P2, and CCTL are required to determine line spacing and page ejects, you wouldn't be able to create proper PDF output.

So I'm afraid that it's not possible today to use a 100% Perl program to convert spoolfiles into PDF in a way that preserves line spacing.

Someday I want to create an MPE-specific Perl extension XS that would allow access to the native MPE file API. With this it would be possible to read spoolfiles correctly. But unfortunately I can't even guess at when I might be able to start a project like this.

Mark Bixby
Perl/iX for HP e3000 MPE (version 5.5) http://www.bixby.org/mark/perlix.html perl hp freeware for mpe/ix (version 6.0) http://jazz.external.hp.com/src/hp_freeware/perl/

A user nofied us:
With perl v5.6.1 built for PA-RISC1.1 only MANAGER.SYS can run PERL.
The problem was the install of PERL did not configure the permissions correctly for all of the libraries the program uses. To display the libraries you type this in at the MPE prompt:
:XEQ VERSION.PUB.SYS PERL.PUB.PERL
Then, check the libraries from this listing in the POSIX shell. Two of mine only had "rwx" for MANAGER.SYS. After I did a 'chmod' on them to allow world access, it worked. The two I had to modify were /usr/lib/libcurses.sl and /usr/lib/libstr.sl.

In Association with Amazon.com

SANFACE Software logo


txt2pdf is a trademark of SANFACE Software 2005.
Your technology glasses. We help you see your full potential.
mailto:sanface@sanface.com WAP http://www.sanface.com/wap/
http://www.sanface.com I-mode http://www.sanface.com/i/

News Shareware IServices Resellers Projects Partnerships