Create PDF files from 3000 output
July 2, 2008
Last year we updated the abilities of the Sanface Software solution to create PDF files out of HP 3000 output. But there are other ways and tools to do this, a task that's become essential to sharing data reports between HP 3000s and the rest of the world's computers.
On the HP 3000 newsgroup, a veteran 3000 developer asked,
Has anyone any experience involving taking a file in an output queue and creating a PDF version of it?
"We use text2pdf v1.1 and have not had any problems since we installed it in October 2001," says Robert Mills of Pinnacle Entertainment. "I have e-mailed a copy of this utility and our command file to 27 people. Never knew that so many sites wanted to generate PDFs from their 3000s."
The program is a good example of 3000 source code solutions. This one was created as far back as the days of MPE/iX 6.0, a system release which HP has not supported since 2005.
Lars Appel, the former HP support engineer who built such things on his own time while at HP support in German, has source code and a compiled copy of the utility.
Such solutions, and many more, are hosted on the Web server at 3K Associates, www.3k.com. Check the Applications Ported to MPE/iX section of the Public Domain Software area at 3K's Web site.
You'll also find a link to GhostPCL up at the site, another Appel creation, one which he describes as
A program that reads PCL input files and converts them to a variety of output formats, including PDF or JPEG, for example. Combined with my little FakeLP Java program, you might even use it to capture MPE/iX network spooler output and generate PDF or JPEG from an MPE/iX spoolfile.
Open source solutions like these have been an HP 3000 community tradition. Way back in 2000, we reported in the NewsWire about that FakeLP Java program, helpful in getting text2pdf to do its PDF magic. (For the record, both Mark Bixby and Appel are still working in the 3000 community, but not for HP; Bixby joins QSS this month, and Appel has been helping in support for the producer of the database Eloquence, Marxmeier Software)
A roadblock to using the text2pdf program: the spoolfiles had to be in text file format to work with it. But Lars Appel offered a free solution to make 3000 spoolfiles that don't rely on CCTLs ready for their PDF closeups:
"I have a small Java program that listens to a given port, for example 9100, and 'pretends to be a network printer' i.e. gets all the data sent and writes it to a flat file. This might be a start, as OUTSPTJ.PUB.SYS should have converted CCTL to plain PCL when sending to a JetDirect printer. However, this little Java program is just a quick and dirty experiment. Use at your own risk; it worked on my 3000, but your mileage may vary."
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cut here _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
// FakeLP pretends network printer to capture spooler PCL output
import java.net.*;
import java.io.*;class FakeLP {
public static void main( String args[] ) throws Exception {
int port = 9100;
int next = 1;if (args.length > 0) port = Integer.parseInt(args[0]);
if (args.length > 1) next = Integer.parseInt(args[1]);ServerSocket serv = new ServerSocket( port );
while (true) {
System.out.println("FakeLP listener ready");
Socket sock = serv.accept();
byte[] buf = new byte[4096];
String name = "F" + (next++);System.out.println("Capturing spoolfile to " + name);
InputStream si = sock.getInputStream();
OutputStream fo = new FileOutputStream(name);for (;;)
{
int got = si.read(buf);if (got != -1)
fo.write(buf, 0, got);
else
break;
}fo.close();
si.close();
}
}
}