Operating System - OpenVMS
1752808 Members
5539 Online
108789 Solutions
New Discussion юеВ

Re: "Printing" reports to PDF file

 
SOLVED
Go to solution

"Printing" reports to PDF file

Hello: You have helped me many times in the past (mostly searching the archives) and I hope you have help me again.

The question: How hard is it to create a print queue that will output PDF files rather than paper reports or to get the print stream output to a text file for conversion.

I am currently maintaining an old system (VAX 7000-630 running OpenVMS V7.1 and DECprint Supervisor V2.4, upgrades currently difficult if not impossible) which generate a large number of reports every night on our LP37 line printer. These reports are generated in a number of ways (COM jobs, cobol applications, APTuser/RTS V4.0 report generator).

We can currently redirect these to our HP9050 laser printers and they format correctly ($ SET ENTRY 'P1'/REQUEUE=LASER$PRINT/PARAM=(PAGE_ORIENT=LANDSCAPE)/FORM=LASER2) on the printer (compressed, page numbers, etc). The thought is to redirect them to a different print queue which would instead convert them to PDF files to be distributed and accessed when needed (and also save several trees a month).

My first thought was to simply use TXT2PDF (which I found reference to here, 2001, VMS mods by Craig Berry) to convert the source file but I ran into a problem. The file was truncated to 94 characters, which could be overcome I am sure, but I am not a C programmer and the obvious change (increasing the float page_width = 594.0; line) did not work. Also, since these are wide reports, getting them turned landscape and compressed would allow them to be printed on standard paper when needed, which is when I started thinking about using a print queue and possibly the stream to the printer as input or emulating the HP printer functions.

Any ideas, hints, or previous discussions pointed to would be greatly appreciated.
29 REPLIES 29
Hoff
Honored Contributor

Re: "Printing" reports to PDF file

Connect the EXECSYMB Freeware "print" symbiont package to Ghostscript or other PDF tools, or to whatever email redistribution process might be required.

Here, I'd probably not concentrate on PDF itself (as I think that conversion is secondary to the real "fun" here), and would initially look to use the provided MIME utility to send the existing text reports via multipart MIME mail messages, or to register the reports in a database.

EXECSYMB does most of what you need here, and the PDF message conversion or MIME mail message creation or the database operations can be conducted using (mostly) DCL.

Coding a custom print symbiont is easy (in the odd case that EXECSYMB isn't able to do or be extended to do what you need), and it would not surprise me to find a print-to-mail symbiont around. And if there is not such a symbiont around, again, a semi-custom print symbiont is (in the absence of unusual requirements) an easy project for sending mail or writing print files to a database or such.

If you're rolling your own, I've posted code to send mail using documented APIs, and there are other examples of that around.

Stephen Hoffman
HoffmanLabs LLC

Robert Gezelter
Honored Contributor

Re: "Printing" reports to PDF file

Steven,

I would suggest getting in touch with someone who is familiar with programming in C and PostScript and the related OpenVMS components for queue processing [disclosure: My firm does provide services in this area, as does Hoff's, Hein's, and several other regular contributors).

I recommend caution, and a [careful] review of the relevant print streams.

- Bob Gezelter, http://www.rlgsc.com
Oswald Knoppers_1
Valued Contributor
Solution

Re: "Printing" reports to PDF file

The mailsymbiont also supports converting ascii to pdf (based on the text2pdf tool by Phil Smith).

See http://oswald.knoppers.googlepages.com/mailsymhome
Jon Pinkley
Honored Contributor

Re: "Printing" reports to PDF file

Oswald Knoppers,

Thanks for the pointer to your mailsym. I will be trying it out.

Jon
it depends

Re: "Printing" reports to PDF file

Thank you all... That last entry may allow me a new direction to follow...
Craig A Berry
Honored Contributor

Re: "Printing" reports to PDF file

I have a revised version of Phil Smith's text2pdf.c, which I would like to attach here, but after literally dozens of failed attempts to do so over the last three days (using different browsers, different login sessions, and other variations), I'll see if I can post without an attachment.

In any case, text2pdf is a very different beast from the txt2pdf referenced in the original query. This one does landscape and has various other features. I've added command-line redirection for VMS (with code lifted from something Martin Vorlaender wrote a long time ago), left and top margin settings via command-line options, and I fixed a bug that caused it to blow up when converting a report in the hundreds of pages. If there is interest, I'll come up with a way of getting this to you, though likely not via the hateful, steaming pile of broken software known as the HP ITRC forums.

Re: "Printing" reports to PDF file

Craig: Thank you. That would be great. I don't know if you can figure out email addresses from this forum but you can send it to: sunderwood[at]sbsb.com

The first one I mentioned earlier is working for landscape (with a small change) but is currently chopping off the first line of every page so if I can get a working version rather than snooping through that one, all the better.

There is also a version of Phil's work inside Oswald's mailsym application. I am working on getting that working now as well but the more choices, the better.

Jon Pinkley
Honored Contributor

Re: "Printing" reports to PDF file

Craig,

Have you considered submitting your enhanced text2pdf to Hunter Goatley's Fileserv?

That is a better repository than ITRC, and there are mirrors, so it is highly available.

Jon
it depends
Craig A Berry
Honored Contributor

Re: "Printing" reports to PDF file

Hmm. What about a zipped copy of the .c file?